GridFS incorrectly rounds sub-millisecond times

XMLWordPrintableJSON

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

      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
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: