mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
18 lines
386 B
Ruby
18 lines
386 B
Ruby
class WakatimeClearTestHeartbeatsJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
include GoodJob::ActiveJobExtensions::Concurrency
|
|
|
|
# Limits concurrency to 1 job per date
|
|
good_job_control_concurrency_with(
|
|
total: 1,
|
|
drop: true
|
|
)
|
|
|
|
def perform
|
|
Heartbeat.where(source_type: "test_entry")
|
|
.where("created_at < ?", 7.days.ago)
|
|
.delete_all
|
|
end
|
|
end
|