You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
class DeleteUnpublishVideoJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
def perform(*args)
|
|
# "清理过时视频,一周之前用户还未确定上传的视频"
|
|
videos = Video.where(transcoded: false, delete_state: nil, status: 'pending').where("updated_at < '#{Time.now.days_ago(7)}'")
|
|
videos.find_each do |d|
|
|
d.destroy
|
|
end
|
|
end
|
|
end
|