mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Move user delete check to front of screenshot worker
This commit is contained in:
parent
1260a856d5
commit
c1705f0c52
1 changed files with 3 additions and 3 deletions
|
@ -11,6 +11,9 @@ class ScreenshotWorker
|
|||
|
||||
def perform(username, path)
|
||||
|
||||
site = Site[username: username]
|
||||
return if site.is_deleted
|
||||
|
||||
queue = Sidekiq::Queue.new self.class.sidekiq_options_hash['queue']
|
||||
logger.info "JOB ID: #{jid} #{username} #{path}"
|
||||
queue.each do |job|
|
||||
|
@ -31,9 +34,6 @@ class ScreenshotWorker
|
|||
scheduled_job.delete
|
||||
end
|
||||
|
||||
site = Site[username: username]
|
||||
return if site.is_deleted
|
||||
|
||||
path = "/#{path}" unless path[0] == '/'
|
||||
|
||||
uri = Addressable::URI.parse $config['screenshot_urls'].sample
|
||||
|
|
Loading…
Add table
Reference in a new issue