mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 16:38:23 +00:00
15 lines
374 B
Ruby
15 lines
374 B
Ruby
class UserSlackStatusUpdateJob < ApplicationJob
|
|
queue_as :latency_10s
|
|
|
|
BATCH_SIZE = 25
|
|
|
|
def perform
|
|
User.where(uses_slack_status: true).find_each(batch_size: BATCH_SIZE) do |user|
|
|
begin
|
|
user.update_slack_status
|
|
rescue => e
|
|
report_error(e, message: "Failed to update Slack status for user #{user.slack_uid}")
|
|
end
|
|
end
|
|
end
|
|
end
|