Skip to content

Commit

Permalink
fix: logging for insufficient data
Browse files Browse the repository at this point in the history
Signed-off-by: s0nicboOm <[email protected]>
  • Loading branch information
s0nicboOm committed Nov 16, 2023
1 parent 46cdfcd commit d78c2ed
Show file tree
Hide file tree
Showing 3 changed files with 1,182 additions and 1,034 deletions.
7 changes: 5 additions & 2 deletions numalogic/udfs/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,21 @@ def ack_read(
metadata.msg_train_records,
)
# If insufficient data: retry after (min_train_records-train_records) * data_granularity
_curr_time = time.time()
if (
_msg_train_records
and _msg_read_ts
and time.time() - float(_msg_read_ts)
and _curr_time - float(_msg_read_ts)
< (min_train_records - int(_msg_train_records)) * data_freq
):
_LOGGER.info(
"%s - There was insufficient data for the key in the past: %s. Retrying fetching"
" and training after %s secs",
uuid,
key,
(min_train_records - int(_msg_train_records)) * data_freq,
_curr_time
- float(_msg_read_ts)
- ((min_train_records - int(_msg_train_records)) * data_freq),
)

return False
Expand Down
Loading

0 comments on commit d78c2ed

Please sign in to comment.