5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/ryespy/listener/fogable.rb', line 5
def check(prefix)
@logger.debug { "prefix: #{prefix}" }
@logger.debug { "redis_key: #{redis_key}" }
seen_files = @redis.hgetall(redis_key)
unseen_files = get_unseen_files(prefix, seen_files)
@logger.debug { "unseen_files: #{unseen_files}" }
unseen_files.each do |filename, checksum|
@redis.hset(redis_key, filename, checksum)
@notifiers.each do |notifier|
notifier.notify(self.class::SIDEKIQ_JOB_CLASS, [filename])
end
end
@logger.info { "#{prefix}* has #{unseen_files.count} new files" }
end
|