mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Adding 'add to queue' to the list of scheduled jobs on monitor interface
This commit is contained in:
parent
887e79a2a5
commit
a6502e68f8
17 changed files with 33 additions and 2 deletions
|
@ -222,6 +222,17 @@ module Sidekiq
|
|||
@parent.schedule(at, item)
|
||||
end
|
||||
|
||||
def add_to_queue
|
||||
Sidekiq.redis do |conn|
|
||||
results = conn.zrangebyscore('schedule', score, score)
|
||||
conn.zremrangebyscore('schedule', score, score)
|
||||
results.map do |message|
|
||||
msg = Sidekiq.load_json(message)
|
||||
Sidekiq::Client.push(msg)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def retry
|
||||
raise "Retry not available on jobs not in the Retry queue." unless item["failed_at"]
|
||||
Sidekiq.redis do |conn|
|
||||
|
|
|
@ -251,9 +251,14 @@ module Sidekiq
|
|||
|
||||
post '/scheduled' do
|
||||
halt 404 unless params['key']
|
||||
halt 404 unless params['delete']
|
||||
|
||||
params['key'].each do |key|
|
||||
Sidekiq::ScheduledSet.new.fetch(*parse_params(key)).first.delete
|
||||
job = Sidekiq::ScheduledSet.new.fetch(*parse_params(key)).first
|
||||
if params['delete']
|
||||
job.delete
|
||||
elsif params['add_to_queue']
|
||||
job.add_to_queue
|
||||
end
|
||||
end
|
||||
redirect "#{root_path}scheduled"
|
||||
end
|
||||
|
|
|
@ -24,6 +24,7 @@ da:
|
|||
ShowAll: Vis alle
|
||||
CurrentMessagesInQueue: Nuværende beskeder i <span class='title'>%{queue}</span>
|
||||
Delete: Slet
|
||||
AddToQueue: Tilføj til kø
|
||||
AreYouSureDeleteJob: Er du sikker på at du vil slette dette job?
|
||||
AreYouSureDeleteQueue: Er du sikker på at du vil slette %{queue} køen?
|
||||
Queues: Køer
|
||||
|
|
|
@ -24,6 +24,7 @@ de:
|
|||
ShowAll: Alle anzeigen
|
||||
CurrentMessagesInQueue: Aktuelle Nachrichten in <span class='title'>%{queue}</span>
|
||||
Delete: Löschen
|
||||
AddToQueue: Add to queue
|
||||
AreYouSureDeleteJob: Möchtest du diesen Job wirklich löschen?
|
||||
AreYouSureDeleteQueue: Möchtest du %{queue} wirklich löschen?
|
||||
Queues: Warteschlangen
|
||||
|
|
|
@ -26,6 +26,7 @@ en: # <---- change this to your locale code
|
|||
ShowAll: Show All
|
||||
CurrentMessagesInQueue: Current messages in <span class='title'>%{queue}</span>
|
||||
Delete: Delete
|
||||
AddToQueue: Add to queue
|
||||
AreYouSureDeleteJob: Are you sure you want to delete this job?
|
||||
AreYouSureDeleteQueue: Are you sure you want to delete the %{queue} queue?
|
||||
Queues: Queues
|
||||
|
|
|
@ -24,6 +24,7 @@ es:
|
|||
ShowAll: Mostrar Todo
|
||||
CurrentMessagesInQueue: Mensajes actualmente en <span class='title'>%{queue}</span>
|
||||
Delete: Eliminar
|
||||
AddToQueue: Añadir a fila
|
||||
AreYouSureDeleteJob: ¿Estás seguro de eliminar este trabajo?
|
||||
AreYouSureDeleteQueue: ¿Estás seguro de eliminar la fila %{queue}?
|
||||
Queues: Filas
|
||||
|
|
|
@ -24,6 +24,7 @@ fr:
|
|||
ShowAll: Montrer Tout
|
||||
CurrentMessagesInQueue: Messages actuellement dans <span class='title'>%{queue}</span>
|
||||
Delete: Supprimer
|
||||
AddToQueue: Ajouter à la liste
|
||||
AreYouSureDeleteJob: Êtes-vous certain de vouloir supprimer cette tâche?
|
||||
AreYouSureDeleteQueue: Êtes-vous certain de vouloir supprimer la file %{queue}?
|
||||
Queues: Queues
|
||||
|
|
|
@ -24,6 +24,7 @@ it:
|
|||
ShowAll: Mostra tutti
|
||||
CurrentMessagesInQueue: Messaggi in <span class='title'>%{queue}</span>
|
||||
Delete: Cancella
|
||||
AddToQueue: Aggiungi a coda
|
||||
AreYouSureDeleteJob: Sei sicuro di voler cancellare questo lavoro?
|
||||
AreYouSureDeleteQueue: Sei sicuro di voler cancellare la coda %{queue}?
|
||||
Queues: Code
|
||||
|
|
|
@ -25,6 +25,7 @@ ja:
|
|||
ShowAll: 全て見せる
|
||||
CurrentMessagesInQueue: <span class='title'>%{queue}</span>に メッセージがあります
|
||||
Delete: 削除
|
||||
AddToQueue: キューに追加
|
||||
AreYouSureDeleteJob: このジョブを削除しますか?
|
||||
AreYouSureDeleteQueue: この %{queue} キューを削除しますか?
|
||||
Queues: キュー
|
||||
|
|
|
@ -25,6 +25,7 @@ ko:
|
|||
ShowAll: 모두 보기
|
||||
CurrentMessagesInQueue: <span class='title'>%{queue}</span>에 대기 중인 메시지
|
||||
Delete: 삭제
|
||||
AddToQueue: 큐 추가
|
||||
AreYouSureDeleteJob: 이 작업을 삭제하시겠습니까?
|
||||
AreYouSureDeleteQueue: 이 %{queue} 큐를 삭제하시겠습니까?
|
||||
Queues: 큐
|
||||
|
|
|
@ -25,6 +25,7 @@ nl:
|
|||
ShowAll: Toon alle
|
||||
CurrentMessagesInQueue: Aantal berichten in <span class='title'>%{queue}</span>
|
||||
Delete: Verwijderen
|
||||
AddToQueue: Toevoegen aan wachtrij
|
||||
AreYouSureDeleteJob: Weet u zeker dat u deze taak wilt verwijderen?
|
||||
AreYouSureDeleteQueue: Weet u zeker dat u wachtrij %{queue} wilt verwijderen?
|
||||
Queues: Wachtrijen
|
||||
|
|
|
@ -25,6 +25,7 @@ no:
|
|||
ShowAll: Vis alle
|
||||
CurrentMessagesInQueue: Nåværende melding i <span class='title'>%{queue}</span>
|
||||
Delete: Slett
|
||||
AddToQueue: Legg til i kø
|
||||
AreYouSureDeleteJob: Er du sikker på at du vil slette denne jobben?
|
||||
AreYouSureDeleteQueue: Er du sikker på at du vil slette køen %{queue}?
|
||||
Queues: Køer
|
||||
|
|
|
@ -24,6 +24,7 @@ pl:
|
|||
ShowAll: Pokaż wszystko
|
||||
CurrentMessagesInQueue: Aktualne wiadomości w kolejce <span class='title'>%{queue}</span>
|
||||
Delete: Usuń
|
||||
AddToQueue: dodaj do kolejki
|
||||
AreYouSureDeleteJob: Czy na pewno usunąć to zadanie?
|
||||
AreYouSureDeleteQueue: Czy na pewno usunąć kolejkę %{queue}?
|
||||
Queues: Kolejki
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
ShowAll: Mostrar todos
|
||||
CurrentMessagesInQueue: Mensagens atualmenta na <span class='title'>%{queue}</span>
|
||||
Delete: Apagar
|
||||
AddToQueue: Adicionar à fila
|
||||
AreYouSureDeleteJob: Deseja deletar esta tarefa?
|
||||
AreYouSureDeleteQueue: Deseja deletar a %{queue} fila?
|
||||
Queues: Filas
|
||||
|
|
|
@ -24,6 +24,7 @@ pt:
|
|||
ShowAll: Mostrar todos
|
||||
CurrentMessagesInQueue: Mensagens na fila <span class='title'>%{queue}</span>
|
||||
Delete: Apagar
|
||||
AddToQueue: Adicionar à fila
|
||||
AreYouSureDeleteJob: Tem a certeza que deseja eliminar esta tarefa?
|
||||
AreYouSureDeleteQueue: Tem a certeza que deseja eliminar a fila %{queue}?
|
||||
Queues: Filas
|
||||
|
|
|
@ -24,6 +24,7 @@ ru:
|
|||
ShowAll: Показать все
|
||||
CurrentMessagesInQueue: Текущие сообщения в <span class='title'>%{queue}</span>
|
||||
Delete: Удалить
|
||||
AddToQueue: Добавить в очередь
|
||||
AreYouSureDeleteJob: Вы уверены в том, что хотите удалить задание?
|
||||
AreYouSureDeleteQueue: Вы уверены в том, что хотите удалить очередь %{queue}?
|
||||
Queues: Очереди
|
||||
|
|
|
@ -26,5 +26,6 @@ header.row
|
|||
td= msg['class']
|
||||
td= display_args(msg['args'])
|
||||
input.btn.btn-danger.pull-right type="submit" name="delete" value="#{t('Delete')}"
|
||||
input.btn.btn-danger.pull-right type="submit" name="add_to_queue" value="#{t('AddToQueue')}"
|
||||
- else
|
||||
.alert.alert-success = t('NoScheduledFound')
|
||||
|
|
Loading…
Reference in a new issue