Skip to content

Commit

Permalink
Add a timestamp to the resumption token
Browse files Browse the repository at this point in the history
We don't use it yet, but:

  * It might be handy for troubleshooting later on

  * It helps the resumption tokens look visually distinct, which can
    avoid confusion
  • Loading branch information
marktriggs committed Jun 16, 2017
1 parent 9866345 commit a7245cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/app/lib/oai/aspace_resumption_token.rb
Expand Up @@ -84,8 +84,10 @@ def self.parse(token, available_record_types)
end

def to_xml
issue_time = (Time.now.to_f * 1000).to_i

xml = Builder::XmlMarkup.new
xml.resumptionToken(Base64::urlsafe_encode64(@options.to_json))
xml.resumptionToken(Base64::urlsafe_encode64(@options.merge('issue_time' => issue_time).to_json))

xml.target!
end
Expand Down

0 comments on commit a7245cf

Please sign in to comment.