scolby33 / OCSPdash

A dashboard for the status of the top certificate authorities' OCSP responders.
MIT License
1 stars 0 forks source link

rate_limited decorator always waits one interval after program startup #44

Open scolby33 opened 5 years ago

scolby33 commented 5 years ago

time.perf_counter() starts at 0, so no rate-limited functions will be called before one time interval has passed.

scolby33 commented 5 years ago

https://github.com/scolby33/OCSPdash/blob/ec8aab86a83a7ad8e425380b59267bdc6cbba173/src/ocspdash/util.py#L99

Maybe change this first value to float('-inf')

@cthoyt do you see a possible problem with that?

cthoyt commented 5 years ago

How about None? Or get busy moving to Pittsburg

scolby33 commented 5 years ago

With None I need

if last_time_called is None: nevermind
else: whatever

vs. with -inf, I can still do the same math I'm doing.

cthoyt commented 5 years ago

okay