@@ -817,6 +817,21 @@ local function match_using_re(obj, pcre)
817
817
return true
818
818
end
819
819
820
+ --- Check whether we meet deadline time.
821
+ ---
822
+ --- The functions raises an exception in the case.
823
+ ---
824
+ --- @tparam table qcontext
825
+ ---
826
+ --- @return nothing
827
+ local function check_deadline_clock (qcontext )
828
+ if clock .monotonic64 () > qcontext .deadline_clock then
829
+ error (e .timeout_exceeded ((
830
+ ' query execution timeout exceeded timeout_ms limit (%s ms)' ):format (
831
+ tostring (qcontext .query_settings .timeout_ms ))))
832
+ end
833
+ end
834
+
820
835
--- Perform unflatten, skipping, filtering, limiting of objects. This is the
821
836
--- core of the `select_internal` function.
822
837
---
@@ -868,11 +883,8 @@ local function process_tuple(self, state, tuple, opts)
868
883
cache_hit_objects_cnt = opts .cache_hit_tuples_cnt ,
869
884
})
870
885
871
- if clock .monotonic64 () > qcontext .deadline_clock then
872
- error (e .timeout_exceeded ((
873
- ' query execution timeout exceeded timeout_ms limit (%s ms)' ):format (
874
- tostring (state .qcontext .query_settings .timeout_ms ))))
875
- end
886
+ check_deadline_clock (qcontext )
887
+
876
888
local collection_name = opts .collection_name
877
889
local pcre = opts .pcre
878
890
local resolveField = opts .resolveField
@@ -1703,7 +1715,7 @@ function accessor_general.new(opts, funcs)
1703
1715
index_lookup_cnt = stat .index_lookup_cnt
1704
1716
})
1705
1717
1706
- -- XXX: check timeout
1718
+ check_deadline_clock ( qcontext )
1707
1719
1708
1720
return fetch_id
1709
1721
end ,
0 commit comments