Class: Clusters::Applications::ScheduleUpdateService
- Inherits:
-
Object
- Object
- Clusters::Applications::ScheduleUpdateService
- Defined in:
- app/services/clusters/applications/schedule_update_service.rb
Constant Summary collapse
- BACKOFF_DELAY =
2.minutes
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(application, project) ⇒ ScheduleUpdateService
constructor
A new instance of ScheduleUpdateService.
Constructor Details
#initialize(application, project) ⇒ ScheduleUpdateService
Returns a new instance of ScheduleUpdateService.
10 11 12 13 |
# File 'app/services/clusters/applications/schedule_update_service.rb', line 10 def initialize(application, project) @application = application @project = project end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application
8 9 10 |
# File 'app/services/clusters/applications/schedule_update_service.rb', line 8 def application @application end |
#project ⇒ Object
Returns the value of attribute project
8 9 10 |
# File 'app/services/clusters/applications/schedule_update_service.rb', line 8 def project @project end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/services/clusters/applications/schedule_update_service.rb', line 15 def execute return unless application if recently_scheduled? worker_class.perform_in(BACKOFF_DELAY, application.name, application.id, project.id, Time.current) else worker_class.perform_async(application.name, application.id, project.id, Time.current) end end |