Skip to content
Snippets Groups Projects
Commit bebced8f authored by Stuart Nelson's avatar Stuart Nelson Committed by Sean McGivern
Browse files

creating background job

parent 391732a2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -7,6 +7,12 @@ module Issues
hook_data
end
 
def schedule_due_date_email(issuable)
return if issuable.due_date.nil?
IssueDueWorker.perform_at(issuable.due_date.to_time, issuable.id)
end
def reopen_service
Issues::ReopenService
end
Loading
Loading
Loading
Loading
@@ -27,6 +27,8 @@ module Issues
todo_service.new_issue(issuable, current_user)
user_agent_detail_service.create
resolve_discussions_with_issue(issuable)
# TODO: Create the scheduled due date email
schedule_due_date_email(issuable)
 
super
end
Loading
Loading
Loading
Loading
@@ -13,6 +13,10 @@ module Issues
spam_check(issue, current_user)
end
 
def after_update(issue)
schedule_due_date_email(issue)
end
def handle_changes(issue, options)
old_associations = options.fetch(:old_associations, {})
old_labels = old_associations.fetch(:labels, [])
Loading
Loading
@@ -23,6 +27,9 @@ module Issues
todo_service.mark_pending_todos_as_done(issue, current_user)
end
 
# TODO: If due date doesn't change, don't bother updating the due date
# email worker
if issue.previous_changes.include?('title') ||
issue.previous_changes.include?('description')
todo_service.update_issue(issue, current_user, old_mentioned_users)
Loading
Loading
Loading
Loading
@@ -78,6 +78,7 @@
- group_destroy
- invalid_gpg_signature_update
- irker
- issue_due
- merge
- namespaceless_project_destroy
- new_issue
Loading
Loading
class IssueDueWorker
include ApplicationWorker
def perform(issue_id)
issue = Issue.find_by_id(issue_id)
# How do we want to deal with noops?
if issue.due_date == Date.today
# execute
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment