add job hook when post is created

This commit is contained in:
Albert Yi
2019-01-30 10:54:27 -08:00
parent 6243925aeb
commit 2961be636a
2 changed files with 17 additions and 1 deletions

View File

@@ -90,6 +90,11 @@ class UploadService
end
upload.update(status: "completed", post_id: @post.id)
if @post.is_pending? && Automod::UpdateDynamoDbJob.enabled?
Delayed::Job.enqueue(Automod::UpdateDynamoDbJob.new(@post.id), run_at: 84.hours.from_now, queue: "default")
end
@post
end