rest-ftp-daemon 0.94.4 → 0.95.2
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 +4 -4
- data/bin/rest-ftp-daemon +2 -1
- data/lib/rest-ftp-daemon/api/job_presenter.rb +1 -1
- data/lib/rest-ftp-daemon/constants.rb +1 -2
- data/lib/rest-ftp-daemon/job.rb +15 -4
- data/lib/rest-ftp-daemon/views/dashboard.haml +3 -3
- data/lib/rest-ftp-daemon/views/dashboard_jobs.haml +5 -4
- data/lib/rest-ftp-daemon/worker_pool.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9df54e0c451475506949a750afee4f8c774b3ae7
|
4
|
+
data.tar.gz: 7d73e198e3b5e9d732db27937010cfa912057752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c3f2f4e7331e3cfb09b0c61005d16429ea3a2a0ac54a223d61c6cb06b45b259ba6d90db6ddf75d851d1d4afc7f28c9f9a069a273795f3828c974783eb699492
|
7
|
+
data.tar.gz: 5cee703b40eb48e6bebc4e78b80d792fe4de5a024b70f6a9b1a72e4fbae56490abb84c3015fb420e6404a95035d650ff5a832aaae5883ffaf2cff19cd4dcda99
|
data/bin/rest-ftp-daemon
CHANGED
@@ -22,7 +22,8 @@ parser = OptionParser.new do |opts|
|
|
22
22
|
opts.on("", "--dev") { APP_ENV = "development" }
|
23
23
|
opts.on("-p", "--port PORT", "use PORT") { |port| options["port"] = port.to_i }
|
24
24
|
opts.on("-w", "--workers COUNT", "Use COUNT worker threads") { |count| options["workers"] = count.to_i }
|
25
|
-
opts.on("-d", "--daemonize", "Run daemonized in the background") { |bool| options["daemonize"] =
|
25
|
+
opts.on("-d", "--daemonize", "Run daemonized in the background") { |bool| options["daemonize"] = true }
|
26
|
+
opts.on("-f", "--foreground", "Run in the foreground") { |bool| options["daemonize"] = false }
|
26
27
|
opts.on("-P", "--pid FILE", "File to store PID") { |file| options["pidfile"] = file }
|
27
28
|
opts.on("-u", "--user NAME", "User to run daemon as (use with -g)") { |user| options["user"] = user }
|
28
29
|
opts.on("-g", "--group NAME", "Group to run daemon as (use with -u)"){ |group| options["group"] = group }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Terrific constants
|
2
2
|
APP_NAME = "rest-ftp-daemon"
|
3
3
|
APP_CONF = "/etc/#{APP_NAME}.yml"
|
4
|
-
APP_VER = "0.
|
4
|
+
APP_VER = "0.95.2"
|
5
5
|
|
6
6
|
# Some global constants
|
7
7
|
IDENT_JOB_LEN = 4
|
@@ -20,4 +20,3 @@ APP_LIBS = File.dirname(__FILE__)
|
|
20
20
|
|
21
21
|
# Debugging
|
22
22
|
DEBUG_FTP_COMMANDS = false
|
23
|
-
|
data/lib/rest-ftp-daemon/job.rb
CHANGED
@@ -14,7 +14,7 @@ module RestFtpDaemon
|
|
14
14
|
attr_reader :error
|
15
15
|
attr_reader :status
|
16
16
|
|
17
|
-
attr_reader :
|
17
|
+
attr_reader :queued_at
|
18
18
|
attr_reader :updated_at
|
19
19
|
|
20
20
|
attr_reader :params
|
@@ -43,7 +43,7 @@ module RestFtpDaemon
|
|
43
43
|
@logger = RestFtpDaemon::Logger.new(:workers, "JOB #{id}")
|
44
44
|
|
45
45
|
# Flag current job
|
46
|
-
@
|
46
|
+
@queued_at = Time.now
|
47
47
|
@status = :created
|
48
48
|
|
49
49
|
# Send first notification
|
@@ -51,6 +51,12 @@ module RestFtpDaemon
|
|
51
51
|
client_notify "rftpd.queued"
|
52
52
|
end
|
53
53
|
|
54
|
+
def close
|
55
|
+
# Close logger
|
56
|
+
info "Job.close"
|
57
|
+
@logger.close
|
58
|
+
end
|
59
|
+
|
54
60
|
def process
|
55
61
|
# Update job's status
|
56
62
|
@error = nil
|
@@ -107,6 +113,9 @@ module RestFtpDaemon
|
|
107
113
|
rescue Errno::ECONNREFUSED => exception
|
108
114
|
return oops "rftpd.ended", exception, :job_connexion_refused
|
109
115
|
|
116
|
+
rescue SocketError => exception
|
117
|
+
return oops "rftpd.ended", exception, :job_socket_error
|
118
|
+
|
110
119
|
rescue Timeout::Error, Errno::ETIMEDOUT => exception
|
111
120
|
return oops "rftpd.ended", exception, :job_timeout
|
112
121
|
|
@@ -160,8 +169,8 @@ module RestFtpDaemon
|
|
160
169
|
protected
|
161
170
|
|
162
171
|
def age
|
163
|
-
return 0 if @
|
164
|
-
(Time.now - @
|
172
|
+
return 0 if @queued_at.nil?
|
173
|
+
(Time.now - @queued_at).round(2)
|
165
174
|
end
|
166
175
|
|
167
176
|
def wander time
|
@@ -337,6 +346,8 @@ module RestFtpDaemon
|
|
337
346
|
|
338
347
|
# Prepare notification if signal given
|
339
348
|
return unless signal_name
|
349
|
+
|
350
|
+
# Send the real notification
|
340
351
|
client_notify signal_name, error_name, notif_status
|
341
352
|
end
|
342
353
|
|
@@ -47,7 +47,7 @@
|
|
47
47
|
%th W
|
48
48
|
%th source
|
49
49
|
%th target
|
50
|
-
%th
|
50
|
+
%th queued
|
51
51
|
%th status
|
52
52
|
%th progress
|
53
53
|
%th error
|
@@ -64,13 +64,13 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
.row
|
67
|
-
.col-md-
|
67
|
+
.col-md-6
|
68
68
|
= render :dashboard_tokens, {tokens: Settings.endpoints || {}}
|
69
69
|
|
70
70
|
.col-md-3
|
71
71
|
= render :dashboard_workers
|
72
72
|
|
73
|
-
.col-md-
|
73
|
+
.col-md-3
|
74
74
|
= render :dashboard_counters
|
75
75
|
|
76
76
|
%br
|
@@ -5,6 +5,7 @@
|
|
5
5
|
- source_processed = job.get(:source_processed) || 0
|
6
6
|
- source_processing = job.get(:source_processing)
|
7
7
|
- presented = present job, :with => RestFtpDaemon::API::Entities::JobPresenter, hide_params: true
|
8
|
+
- errmsg = job.get :error_message
|
8
9
|
|
9
10
|
- if !job.error.nil?
|
10
11
|
- trclass = "danger"
|
@@ -25,8 +26,6 @@
|
|
25
26
|
= job.priority
|
26
27
|
|
27
28
|
%td
|
28
|
-
|
29
|
-
|
30
29
|
- unless job.wid.nil?
|
31
30
|
.label.label-warning.flag= "w#{job.wid}"
|
32
31
|
|
@@ -40,7 +39,7 @@
|
|
40
39
|
= Helpers.highlight_tokens job.target
|
41
40
|
|
42
41
|
%td
|
43
|
-
= Helpers.datetime_short(job.
|
42
|
+
= Helpers.datetime_short(job.queued_at)
|
44
43
|
|
45
44
|
%td
|
46
45
|
= job.status
|
@@ -60,7 +59,9 @@
|
|
60
59
|
- unless source_processing.nil?
|
61
60
|
%small= " (#{source_processing})"
|
62
61
|
- else
|
63
|
-
|
62
|
+
.error{title: errmsg}
|
63
|
+
= Helpers.text_or_empty(job.error)
|
64
|
+
|
64
65
|
|
65
66
|
%td.nobr.text-right
|
66
67
|
= Helpers.format_bytes(size, "B")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-ftp-daemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.95.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno MEDICI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|