nfagent 0.9.6 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nfagent.rb +1 -1
- data/lib/nfagent/client.rb +1 -1
- data/lib/nfagent/server.rb +1 -5
- data/lib/nfagent/submitter.rb +12 -0
- metadata +2 -2
data/lib/nfagent.rb
CHANGED
data/lib/nfagent/client.rb
CHANGED
@@ -6,7 +6,7 @@ module NFAgent
|
|
6
6
|
proxy_class = Net::HTTP::Proxy(Config.proxy.host, Config.proxy.port, Config.proxy.user, Config.proxy.password)
|
7
7
|
# TODO: Enable SSL
|
8
8
|
proxy_class.start(SERVICE_HOST, 80) do |http|
|
9
|
-
http.read_timeout =
|
9
|
+
http.read_timeout = 120 # 2 minutes TODO: Make this a config option with 120 as default
|
10
10
|
req = Net::HTTP::Post.new("/#{end_point}")
|
11
11
|
req.set_form_data(data_hash.merge("key" => Config.client_key))
|
12
12
|
ClientResponse.new do |resp|
|
data/lib/nfagent/server.rb
CHANGED
data/lib/nfagent/submitter.rb
CHANGED
@@ -22,6 +22,18 @@ module NFAgent
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
# Actually runs the submitter
|
26
|
+
# every 'seconds' seconds after
|
27
|
+
# the last one completes
|
28
|
+
def self.run_every(seconds)
|
29
|
+
callback = proc { run_every(seconds) }
|
30
|
+
EM::add_timer(seconds) do
|
31
|
+
EM::defer(nil, callback) do
|
32
|
+
resubmit_failed_dumps
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
25
37
|
# TODO: Change attempt logic
|
26
38
|
# Add the next timestamp for when submission should be attenpted again to the end of the filename
|
27
39
|
def self.resubmit_failed_dumps
|