Skip to content

Commit 68a1a79

Browse files
committed
no need to manually restart sidekiq now
1 parent da687ac commit 68a1a79

12 files changed

Lines changed: 378 additions & 36 deletions

File tree

app/admin/audio/audio_recitation.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,10 @@
113113
Audio::GenerateAudioFilesJob.perform_later(resource)
114114
'Audio files will be generated in a few sec.'
115115
else
116-
Audio::UpdateMetaDataJob.perform_later(resource)
116+
Audio::UpdateMetaDataJob.perform_later(resource, force: true)
117117
'Meta data will be refreshed in a few sec.'
118118
end
119119

120-
# Restart sidekiq if it's not running
121-
Utils::System.start_sidekiq
122120
redirect_to [:cms, resource], notice: notice
123121
end
124122

@@ -153,9 +151,6 @@
153151
create_ayah_recitation: ayah_recitation_id.blank? && params[:create_ayah_recitation] == '1'
154152
)
155153

156-
# Restart sidekiq if it's not running
157-
Utils::System.start_sidekiq
158-
159154
return redirect_to [:cms, resource], alert: "Ayah by ayah gapped recitation will be generated shortly."
160155
end
161156
end

app/admin/audio/chapter_audio_file.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@
135135
end
136136

137137
member_action :refresh_meta, method: 'put' do
138-
Audio::UpdateMetaDataJob.perform_later(resource.audio_recitation, chapter_id: resource.chapter_id)
139-
140-
# Restart sidekiq if it's not running
141-
Utils::System.start_sidekiq
138+
Audio::UpdateMetaDataJob.perform_later(resource.audio_recitation, chapter_id: resource.chapter_id, force: true)
142139

143140
redirect_to [:cms, resource], notice: 'Meta data will be refreshed in a few sec.'
144141
end

app/admin/audio/recitation.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,10 @@
7979
Audio::GenerateAudioFilesJob.perform_later(resource)
8080
'Audio files will be generated in a few sec.'
8181
else
82-
Audio::UpdateMetaDataJob.perform_later(resource)
82+
Audio::UpdateMetaDataJob.perform_later(resource, force: true)
8383
'Meta data will be refreshed in a few sec.'
8484
end
8585

86-
# Restart sidekiq if it's not running
87-
Utils::System.start_sidekiq
8886
redirect_to [:cms, resource], notice: notice
8987
end
9088

@@ -280,9 +278,6 @@
280278
manifest_version: manifest_version
281279
)
282280

283-
# Restart sidekiq if it's not running
284-
Utils::System.start_sidekiq
285-
286281
redirect_back(fallback_location: '/cms', notice: "Recitation segments export job enqueued (format: #{format}). You will receive an email when finished.")
287282
end
288283
end

app/admin/content/resource_content.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111

112112
member_action :import_draft, method: 'put' do
113113
authorize! :manage, resource
114-
Utils::System.start_sidekiq
115114

116115
if params[:approved]
117116
if resource.tafsir?
@@ -157,7 +156,6 @@
157156

158157
member_action :import_draft_content, method: 'put' do
159158
authorize! :manage, resource
160-
Utils::System.start_sidekiq
161159

162160
if params[:approved]
163161
if resource.tafsir?

app/admin/database_backup.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
collection_action :admin_action, method: 'put' do
1111
if can? :admin, :run_actions
12-
# Restart sidekiq if it's not running
13-
Utils::System.start_sidekiq
14-
1512
case params[:name].to_s
1613
when 'new_db_dump'
1714
BackupJob.perform_later

app/admin/downloads/downloadable_resource.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
if request.get?
4444
render partial: 'admin/confirm_refresh_downloadable_resource'
4545
else
46-
# Restart sidekiq if it's not running
47-
Utils::System.start_sidekiq
4846
notify = params[:notify_users] == '1'
4947
AsyncResourceActionJob.perform_later(resource, :refresh_export!, send_update_email: notify)
5048

@@ -54,8 +52,6 @@
5452

5553
member_action :notify_users, method: 'put', if: -> { can? :notify_users, resource } do
5654
authorize! :notify_users, resource
57-
# Restart sidekiq if it's not running
58-
Utils::System.start_sidekiq
5955

6056
resource.notify_users
6157
redirect_to [:cms, resource], notice: "System will send email to all users who has downloaded this resource."

app/admin/quran/mushaf.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@
136136
user_id: current_user.id,
137137
mushaf_ids: mushaf_ids
138138
)
139-
# Restart sidekiq if it's not running
140-
Utils::System.start_sidekiq
141139

142140
redirect_back(fallback_location: '/cms', notice: 'Mushaf layouts db will be exported and shared with you on your email shortly')
143141
end

app/admin/quran/word.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,6 @@ def scoped_collection
583583
language_id: language,
584584
word_fields: word_fields
585585
)
586-
# Restart sidekiq if it's not running
587-
Utils::System.start_sidekiq
588-
589586
redirect_back(fallback_location: '/cms', notice: 'Words dump will be prepared and sent to your email soon')
590587
end
591588

app/javascript/controllers/ayah_boundary_controller.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Controller } from "@hotwired/stimulus"
1111
export default class extends Controller {
1212
static targets = [
1313
"player", "popup", "canvas", "title", "text", "waveLabel", "form",
14-
"keyField", "occurrenceField", "startInput", "endInput",
14+
"numberField", "startInput", "endInput",
1515
"playButton", "popupDuration", "prevButton", "nextButton"
1616
]
1717
static values = { audioUrl: String, ayahs: Array }
@@ -163,11 +163,9 @@ export default class extends Controller {
163163
const ayah = this.ayahsValue[this.activeIndex]
164164
if (!ayah) return
165165

166-
const suffix = ayah.occurrence > 0 ? ` (occurrence ${ayah.occurrence + 1})` : ""
167-
this.titleTarget.textContent = `Ayah ${ayah.number}${suffix}`
166+
this.titleTarget.textContent = `Ayah ${ayah.number}`
168167
this.textTarget.textContent = ayah.text || ""
169-
this.keyFieldTarget.value = ayah.key
170-
this.occurrenceFieldTarget.value = ayah.occurrence
168+
this.numberFieldTarget.value = ayah.number
171169
this.startInputTarget.value = ayah.start == null ? "" : Number(ayah.start).toFixed(3)
172170
this.endInputTarget.value = ayah.end == null ? "" : Number(ayah.end).toFixed(3)
173171

0 commit comments

Comments
 (0)