clacks 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a1c27d5e5f6c56ee4b1d62cde1fd55b1a4757e6
4
- data.tar.gz: c1b698e3b81baec4608e9c4a302f1f04dbe5020f
3
+ metadata.gz: a8cec8c374d947ac86ab6786daa84511fa37fb6d
4
+ data.tar.gz: fb521af53dd6ea679a483a3e923d35b1b0bb58ec
5
5
  SHA512:
6
- metadata.gz: bfffd9efadc5f9801a004b70bc34a5ddeeb4eed17ccb4d4b4a6e206ac5999ee709f6277838404faaf6dc65334ebdb535f96f4627554a56f233eaf8205debdb37
7
- data.tar.gz: 9e70bd29df57273484a6e14b96a639a3e805947f76a6603c089b6fb9a337562799b348169a2575d55bdc0276ac07d5fbd55d17621434182e956155c83a4f1c39
6
+ metadata.gz: cb257eab94536ef5fb17ad1f803214b851cc53ed8c7cec0a13be9fbbdbb3d744ac92713c97c26391aa8c00084d0a4eee101ef4dbe90628221c919ab1701ebfd3
7
+ data.tar.gz: 355898f3c5e09358765d114b1fbf3414f73df43f335909947a88e61784034af4ed6517fe8ac85186916f9d4c58a0222204ac306132953b5661834e80bda1b41f
@@ -10,7 +10,7 @@ module Clacks
10
10
  # IMAP server timeout: typically after 30 minutes with no activity.
11
11
  # NAT Gateway timeout: typically after 15 minutes with an idle connection.
12
12
  # The solution to this is for the IMAP client to issue a NOOP (No Operation) command
13
- # at intervals, typically every 12 minutes.
13
+ # at intervals, typically every 29 minutes.
14
14
  WATCHDOG_SLEEP = 5 * 60 # 5 minutes
15
15
 
16
16
  def run
@@ -55,8 +55,10 @@ module Clacks
55
55
  config = Clacks.config[:imap]
56
56
  options = Clacks.config[:find_options]
57
57
  processor = Mail::IMAP.new(config)
58
- require 'clacks/stdlib_extensions/ruby_1_8' if RUBY_VERSION.to_f < 1.9
59
- Net::IMAP.debug = $DEBUG
58
+ if $DEBUG
59
+ Net::IMAP.debug = true
60
+ Clacks.logger.level = Logger::DEBUG
61
+ end
60
62
  imap_validate_options(options)
61
63
  if imap_idle_support?(processor)
62
64
  Clacks.logger.info("Clacks IMAP idling #{config[:user_name]}@#{config[:address]}")
@@ -99,6 +101,7 @@ module Clacks
99
101
  break if stopping?
100
102
  finding { imap_find(imap) }
101
103
  # http://tools.ietf.org/rfc/rfc2177.txt
104
+ Clacks.logger.debug('imap.idle start')
102
105
  imap.idle do |r|
103
106
  Clacks.logger.debug('imap.idle yields')
104
107
  if r.instance_of?(Net::IMAP::UntaggedResponse) && r.name == 'EXISTS'
@@ -135,10 +138,8 @@ module Clacks
135
138
  Clacks.logger.debug('watchdog is awake')
136
139
  @imap.idle_done
137
140
  Clacks.logger.debug('watchdog send idle done')
138
- @imap.noop
139
- Clacks.logger.debug('watchdog send noop')
140
141
  rescue StandardError => e
141
- Clacks.logger.debug("watchdog received error: #{e.message}")
142
+ Clacks.logger.debug("watchdog received error: #{e.message} (#{e.class})\n#{(e.backtrace || []).join("\n")}")
142
143
  # noop
143
144
  rescue Exception => e
144
145
  fatal(e)
@@ -1,3 +1,3 @@
1
1
  module Clacks
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clacks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITRP