{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/17629","labels_url":"https://api.github.com/repos/rails/rails/issues/17629/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/17629/comments","events_url":"https://api.github.com/repos/rails/rails/issues/17629/events","html_url":"https://github.com/rails/rails/issues/17629","id":48897561,"number":17629,"title":"ActiveJob after_perform never gets triggered ","user":{"login":"devmarwen","id":5075379,"avatar_url":"https://avatars.githubusercontent.com/u/5075379?v=3","gravatar_id":"","url":"https://api.github.com/users/devmarwen","html_url":"https://github.com/devmarwen","followers_url":"https://api.github.com/users/devmarwen/followers","following_url":"https://api.github.com/users/devmarwen/following{/other_user}","gists_url":"https://api.github.com/users/devmarwen/gists{/gist_id}","starred_url":"https://api.github.com/users/devmarwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devmarwen/subscriptions","organizations_url":"https://api.github.com/users/devmarwen/orgs","repos_url":"https://api.github.com/users/devmarwen/repos","events_url":"https://api.github.com/users/devmarwen/events{/privacy}","received_events_url":"https://api.github.com/users/devmarwen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/activejob","name":"activejob","color":"5319e7"},{"url":"https://api.github.com/repos/rails/rails/labels/needs%20feedback","name":"needs feedback","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2014-11-15T11:13:16Z","updated_at":"2015-01-26T17:46:32Z","closed_at":null,"body":"I'm using rails 4.2.0.beta4 with `resque` and `resque-scheduler`\r\nHere is my code:\r\n```\r\nclass ContactMailerJob < ActiveJob::Base\r\n  queue_as :default\r\n\r\n  def perform user\r\n    ContactMailer.login_information(user).deliver_now\r\n  end\r\n\r\n  before_enqueue do |j|\r\n    create_job_record(j, 'before_enqueue')\r\n  end\r\n  after_enqueue do |j|\r\n    update_job_record(j, 'after enqueue')\r\n  end\r\n  after_perform do |j|\r\n    update_job_record(j, 'after perform')\r\n  end\r\n\r\n  def create_job_record j, state\r\n    job = Job.new(job_id: j.job_id, user_id: 1)\r\n    job.name = 'contact mailer sender'\r\n    job.state = state\r\n    job.save\r\n  end\r\n\r\n  def update_job_record j, state\r\n    job = Job.where(job_id: j.job_id, user_id: 1).first\r\n    job.state = state\r\n    job.save\r\n  end\r\n```\r\ncalled by:\r\n```\r\n    ContactMailerJob.perform_later user\r\n```\r\nThis code is only for test purpose, my end goal is to record the different states of the job, so correct me if I'm wrong: `after_perform` is triggered after when the job is finished. In the code above `after/before_enqueue` works just fine but not `after_perform`, it doesn't get triggered."},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/71503356","html_url":"https://github.com/rails/rails/issues/17629#issuecomment-71503356","issue_url":"https://api.github.com/repos/rails/rails/issues/17629","id":71503356,"user":{"login":"devmarwen","id":5075379,"avatar_url":"https://avatars.githubusercontent.com/u/5075379?v=3","gravatar_id":"","url":"https://api.github.com/users/devmarwen","html_url":"https://github.com/devmarwen","followers_url":"https://api.github.com/users/devmarwen/followers","following_url":"https://api.github.com/users/devmarwen/following{/other_user}","gists_url":"https://api.github.com/users/devmarwen/gists{/gist_id}","starred_url":"https://api.github.com/users/devmarwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devmarwen/subscriptions","organizations_url":"https://api.github.com/users/devmarwen/orgs","repos_url":"https://api.github.com/users/devmarwen/repos","events_url":"https://api.github.com/users/devmarwen/events{/privacy}","received_events_url":"https://api.github.com/users/devmarwen/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T17:46:32Z","updated_at":"2015-01-26T17:46:32Z","body":"@paezao No just the regular one."}}