Skip to content

Commit

Permalink
misc(events): Add option to remove event validations job (#2266)
Browse files Browse the repository at this point in the history
## Context

This is a very bad feature, we should think about disable it, and remove
it very soon.
Scalability = 0

## Description

- Give the option to disable the events validation
  • Loading branch information
jdenquin committed Jul 9, 2024
1 parent 7524227 commit c34a3cc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions clock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ module Clockwork
.perform_later
end

every(1.hour, 'schedule:post_validate_events', at: '*:05') do
Clock::EventsValidationJob
.set(sentry: {"slug" => 'lago_post_validate_events', "cron" => '5 */1 * * *'})
.perform_later
rescue => e
Sentry.capture_exception(e)
unless ActiveModel::Type::Boolean.new.cast(ENV['LAGO_DISABLE_EVENTS_VALIDATION'])
every(1.hour, 'schedule:post_validate_events', at: '*:05') do
Clock::EventsValidationJob
.set(sentry: {"slug" => 'lago_post_validate_events', "cron" => '5 */1 * * *'})
.perform_later
rescue => e
Sentry.capture_exception(e)
end
end
end

0 comments on commit c34a3cc

Please sign in to comment.