Merge pull request #4598 from okriuchykhin/ok_SCI_7435

Fix Fluics templates sync scheduler [SCI-7435]
This commit is contained in:
Alex Kriuchykhin 2022-11-08 13:03:41 +01:00 committed by GitHub
commit e13cfa2c74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@ require 'rufus-scheduler'
scheduler = Rufus::Scheduler.singleton
if ENV['ENABLE_TEMPLATES_SYNC']
if ENV['ENABLE_TEMPLATES_SYNC'] == 'true'
# Templates sync periodic task
scheduler.every '12h' do
Rails.logger.info('Templates, syncing all template projects')
@ -33,8 +33,8 @@ if Rails.application.secrets.system_notifications_uri.present? &&
end
end
if ENV['ENABLE_FLUICS_SYNC'] && LabelPrinter.fluics.any?
if ENV['ENABLE_FLUICS_SYNC'] == 'true'
scheduler.every '24h' do
LabelPrinters::Fluics::SyncService.new.sync_templates!
LabelPrinters::Fluics::SyncService.new.sync_templates! if LabelPrinter.fluics.any?
end
end