Exception: Parse::MongoDB::ExecutionTimeout
- Inherits:
-
StandardError
- Object
- StandardError
- Parse::MongoDB::ExecutionTimeout
- Defined in:
- lib/parse/mongodb.rb
Overview
Error raised when MongoDB cancels a query because it exceeded the requested maxTimeMS budget (MongoDB error code 50 / MaxTimeMSExpired). This is the DB-side counterpart to Agent::ToolTimeoutError and is raised by aggregate / find when the driver reports code 50.
Instance Attribute Summary collapse
-
#collection_name ⇒ String
readonly
The collection that was being queried.
-
#max_time_ms ⇒ Integer
readonly
The maxTimeMS budget that was exceeded.
Instance Method Summary collapse
-
#initialize(collection_name:, max_time_ms:) ⇒ ExecutionTimeout
constructor
A new instance of ExecutionTimeout.
Constructor Details
#initialize(collection_name:, max_time_ms:) ⇒ ExecutionTimeout
Returns a new instance of ExecutionTimeout.
132 133 134 135 136 |
# File 'lib/parse/mongodb.rb', line 132 def initialize(collection_name:, max_time_ms:) @max_time_ms = max_time_ms @collection_name = collection_name super("Query on '#{collection_name}' exceeded max_time_ms=#{max_time_ms}ms — narrow filter or add index") end |
Instance Attribute Details
#collection_name ⇒ String (readonly)
Returns the collection that was being queried.
128 129 130 |
# File 'lib/parse/mongodb.rb', line 128 def collection_name @collection_name end |
#max_time_ms ⇒ Integer (readonly)
Returns the maxTimeMS budget that was exceeded.
126 127 128 |
# File 'lib/parse/mongodb.rb', line 126 def max_time_ms @max_time_ms end |