Merge pull request #17 from 24c02/slack-status-timing

slack status job: make statuses expire in sensible amount of time
This commit is contained in:
Max Wofford 2025-03-03 15:03:24 -05:00 committed by GitHub
commit eb08d852b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,7 +50,7 @@ class User < ApplicationRecord
current_project_duration = Heartbeat.duration_seconds(current_project_heartbeats)
current_project_duration_formatted = Heartbeat.duration_simple(current_project_heartbeats)
# for 0 duration, don't set a status
# for 0 duration, don't set a status this will let status expire when the user has not been cooking today
return if current_project_duration.zero?
status_emoji =
@ -84,7 +84,7 @@ class User < ApplicationRecord
profile: {
status_text:,
status_emoji:,
status_expiration: Date.today.to_time.to_i + (1.hour.to_i * 1000)
status_expiration: (Time.now + 30.minutes).to_i
}
})
end