Skip to content

Commit

Permalink
Merge pull request #3460 from evanrolfe/refactor/active_job3
Browse files Browse the repository at this point in the history
[api] Issue#fetch_issues uses ActiveJob
  • Loading branch information
hennevogel committed Aug 1, 2017
2 parents 038b12c + 02b8d48 commit 0f97947
Show file tree
Hide file tree
Showing 5 changed files with 530 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/api/app/jobs/issue_tracker_fetch_issues_job.rb
@@ -0,0 +1,7 @@
class IssueTrackerFetchIssuesJob < ApplicationJob
queue_as :issuetracking

def perform(issue_tracker_id)
IssueTracker.find(issue_tracker_id).fetch_issues
end
end
3 changes: 1 addition & 2 deletions src/api/app/models/issue.rb
Expand Up @@ -57,8 +57,7 @@ def self.valid_name?(tracker, name)

after_create :fetch_issues
def fetch_issues
# inject update jobs after issue got created
issue_tracker.delay(queue: 'issuetracking').fetch_issues
IssueTrackerFetchIssuesJob.perform_later(issue_tracker.id)
end

def fetch_updates
Expand Down

0 comments on commit 0f97947

Please sign in to comment.