mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-10 01:31:45 +00:00
23 lines
786 B
Ruby
23 lines
786 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module Sessions
|
|
module CacheStoreCoder
|
|
extend self
|
|
include ActiveSupport::Cache::SerializerWithFallback[:marshal_7_1]
|
|
|
|
def load(payload)
|
|
unmarshalled = super
|
|
|
|
return unmarshalled if unmarshalled.is_a?(ActiveSupport::Cache::Entry)
|
|
|
|
# The session payload coming from the old `RedisStore` is a hash,
|
|
# whereas payload from `CacheStore` expects the hash to be wrapped in `ActiveSupport::Cache::Entry`.
|
|
# The payload here is re-wrapped to make old sessions compatible when read by `CacheStore`.
|
|
# https://gitlab.com/gitlab-com/gl-infra/data-access/durability/team/-/issues/35#note_2278902354
|
|
ActiveSupport::Cache::Entry.new(unmarshalled)
|
|
end
|
|
end
|
|
end
|
|
end
|