Sha256: f58b13ab4b9a9447f5a1f1f3c29ade606cb1b3cc54143240c9dbd6b65f4cbce2
Contents?: true
Size: 649 Bytes
Versions: 17
Compression:
Stored size: 649 Bytes
Contents
module Imap::Backup class FlagRefresher attr_reader :folder attr_reader :serializer CHUNK_SIZE = 100 def initialize(folder, serializer) @folder = folder @serializer = serializer end def run uids = serializer.uids.clone uids.each_slice(CHUNK_SIZE) do |block| refresh_block block end end private def refresh_block(uids) uids_and_flags = folder.fetch_multi(uids, ["FLAGS"]) uids_and_flags.each do |uid_and_flags| uid = uid_and_flags[:uid] flags = uid_and_flags[:flags] serializer.update(uid, flags: flags) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems