Closed seanshahkarami closed 2 years ago
This PR added type and approximate unit checking for publish timestamps. Specifically it does:
Step 1. Check if timestamp is int. Step 2. Check if timestamp is after 2000-01-01 00:00:00 UTC in nanoseconds since epochs.
Step 1 is intended to catch accidental uses of time.time() or arithmetic errors like:
time.time()
timestamp = get_timestamp() + skip_second * 1e9
Step 2 is intended to approximately catch accidental uses of second based timestamps.
This PR added type and approximate unit checking for publish timestamps. Specifically it does:
Step 1. Check if timestamp is int. Step 2. Check if timestamp is after 2000-01-01 00:00:00 UTC in nanoseconds since epochs.
Step 1 is intended to catch accidental uses of
time.time()
or arithmetic errors like:Step 2 is intended to approximately catch accidental uses of second based timestamps.