rest-ftp-daemon 0.221.2 → 0.222.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/.rubocop.yml +859 -0
- data/Gemfile.lock +34 -3
- data/README.md +6 -1
- data/Rakefile +8 -1
- data/bin/rest-ftp-daemon +9 -9
- data/config.ru +3 -3
- data/lib/rest-ftp-daemon.rb +43 -43
- data/lib/rest-ftp-daemon/api/dashboard.rb +14 -4
- data/lib/rest-ftp-daemon/api/job_presenter.rb +1 -1
- data/lib/rest-ftp-daemon/api/jobs.rb +42 -42
- data/lib/rest-ftp-daemon/api/root.rb +37 -17
- data/lib/rest-ftp-daemon/constants.rb +8 -8
- data/lib/rest-ftp-daemon/helpers.rb +12 -13
- data/lib/rest-ftp-daemon/job.rb +24 -23
- data/lib/rest-ftp-daemon/job_queue.rb +8 -9
- data/lib/rest-ftp-daemon/logger.rb +2 -14
- data/lib/rest-ftp-daemon/logger_pool.rb +1 -1
- data/lib/rest-ftp-daemon/notification.rb +5 -5
- data/lib/rest-ftp-daemon/paginate.rb +4 -3
- data/lib/rest-ftp-daemon/settings.rb +11 -11
- data/lib/rest-ftp-daemon/uri.rb +2 -2
- data/lib/rest-ftp-daemon/views/dashboard_table.haml +1 -1
- data/lib/rest-ftp-daemon/worker.rb +1 -1
- data/lib/rest-ftp-daemon/worker_conchita.rb +3 -3
- data/lib/rest-ftp-daemon/worker_job.rb +3 -3
- data/lib/rest-ftp-daemon/worker_pool.rb +6 -9
- data/rest-ftp-daemon.gemspec +3 -1
- data/rest-ftp-daemon.yml.sample +12 -11
- data/spec/rest-ftp-daemon/features/dashboard_spec.rb +23 -0
- data/spec/spec_helper.rb +62 -0
- data/spec/support/config.yml +26 -0
- metadata +35 -4
- data/lib/rest-ftp-daemon/api/debug.rb +0 -31
- data/lib/rest-ftp-daemon/api/status.rb +0 -33
@@ -1,31 +0,0 @@
|
|
1
|
-
module RestFtpDaemon
|
2
|
-
module API
|
3
|
-
class Root < Grape::API
|
4
|
-
|
5
|
-
####### GET /debug
|
6
|
-
|
7
|
-
get '/raise' do
|
8
|
-
log_info "GET /debug"
|
9
|
-
begin
|
10
|
-
raise RestFtpDaemon::DummyException
|
11
|
-
rescue RestFtpDaemon::RestFtpDaemonException => exception
|
12
|
-
status 501
|
13
|
-
api_error exception
|
14
|
-
rescue Exception => exception
|
15
|
-
status 501
|
16
|
-
api_error exception
|
17
|
-
else
|
18
|
-
status 200
|
19
|
-
{}
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
get '/routes' do
|
24
|
-
info "GET /routes"
|
25
|
-
status 200
|
26
|
-
return RestFtpDaemon::API::Root::routes
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module RestFtpDaemon
|
2
|
-
module API
|
3
|
-
class Root < Grape::API
|
4
|
-
|
5
|
-
|
6
|
-
####### GET /status
|
7
|
-
|
8
|
-
# Server global status
|
9
|
-
get '/status' do
|
10
|
-
log_info "GET /status"
|
11
|
-
mem = GetProcessMem.new
|
12
|
-
|
13
|
-
status 200
|
14
|
-
return {
|
15
|
-
hostname: `hostname`.chomp,
|
16
|
-
version: APP_VER,
|
17
|
-
started: APP_STARTED,
|
18
|
-
uptime: (Time.now - APP_STARTED).round(1),
|
19
|
-
counters: $queue.counters,
|
20
|
-
memory_bytes: mem.bytes.to_i,
|
21
|
-
memory_mb: mem.mb.round(0),
|
22
|
-
status: $queue.counts_by_status,
|
23
|
-
workers: $pool.worker_variables,
|
24
|
-
jobs_count: $queue.jobs_count,
|
25
|
-
jobs_queued: $queue.queued_ids,
|
26
|
-
config: Helpers.get_censored_config,
|
27
|
-
#routes: RestFtpDaemon::API::Root::routes,
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|