Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit 6100dd7

Browse files
committed
Added github collect statistics job and open sidekiq UI to the admin role
1 parent 1b9df78 commit 6100dd7

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,6 @@ Style/RescueStandardError:
678678
- 'app/lib/json_web_token.rb'
679679
- 'app/lib/send_grid_client.rb'
680680
- 'config/initializers/core_extensions/devise/strategies/json_web_token.rb'
681-
- 'lib/tasks/git_hub.rake'
682681
- 'lib/tasks/meetup.rake'
683682
- 'lib/tasks/resource.rake'
684683
- 'lib/tasks/users.rake'

.ruby-gemset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
operationcode_backend
1+
-global
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class GithubCollectStatisticsJob
2+
include Sidekiq::Worker
3+
4+
def perform
5+
limit = GitHub::Client.new.rate_limit
6+
logger.info("Github Ratelimit: #{limit}")
7+
8+
GitHub::PullRequests.new.fetch_and_save!
9+
GitHub::Issues.new.fetch_and_save!
10+
end
11+
end

config/job_schedule.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ meetup_member_sync_job:
1818
cron: "0 4 * * *"
1919
class: "MeetupMemberSyncJob"
2020
queue: "default"
21+
22+
# At 03:00 every day run the github collect statistics job
23+
github_collect_statistics_job:
24+
cron: "0 3 * * *"
25+
class: "GithubCollectStatisticsJob"
26+
queue: "default"

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
require 'sidekiq/web'
77
require 'sidekiq/cron/web'
8-
authenticate :admin_user, ->(u) { u.role.super_admin? } do
8+
authenticate :admin_user, ->(u) { u.role.admin_accessible? } do
99
mount Sidekiq::Web => '/admin/sidekiq'
1010
end
1111

lib/tasks/git_hub.rake

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)