Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2216

GridFS incorrectly rounds sub-millisecond times

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: GridFS

      In lib/mongo/grid/file/info.rb there is the following code:

              def default_document
                BSON::Document.new(
                  :_id => BSON::ObjectId.new,
                  :chunkSize => Chunk::DEFAULT_SIZE,
                  # MongoDB stores times with millisecond precision
                  :uploadDate => Time.now.utc.round(3),
                  :contentType => DEFAULT_CONTENT_TYPE
                )
              end
      

      The round(3) call needs to be replaced by the rounding we perform elsewhere which rounds down instead of rounding to nearest and handles jruby rounding the negative times in the wrong direction.

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: