You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up to #1612 which was closed by #1625.
The PR fixed half of the problem. The issue is that the rake task doorkeeper:db:cleanup:expired_tokens will still delete tokens which haven't yet expired. The reason is that the expires_in column is not considered.
Compare the logic in
classStaleRecordsCleaner# This method compares against `created_at`defclean_expired(ttl)table=@base_scope.arel_table@base_scope.where.not(expires_in: nil).where(table[:created_at].lt(Time.current - ttl)).in_batches(&:delete_all)endend
With
moduleExpirable# This method compares against `expires_at`defexpired?
!!(expires_in && Time.now.utc > expires_at)endend
The text was updated successfully, but these errors were encountered:
And these 2 statements are equivalent. (I only have a doubt about Time.current vs Time.now.utc, I guess it's fine as long as you have UTC configured as a time zone)
This is a follow-up to #1612 which was closed by #1625.
The PR fixed half of the problem. The issue is that the rake task
doorkeeper:db:cleanup:expired_tokens
will still delete tokens which haven't yet expired. The reason is that theexpires_in
column is not considered.Compare the logic in
With
The text was updated successfully, but these errors were encountered: