Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP endpoints: readings deleted on non-200 status code #18

Closed
tbbuck opened this issue Aug 17, 2022 · 1 comment
Closed

HTTP endpoints: readings deleted on non-200 status code #18

tbbuck opened this issue Aug 17, 2022 · 1 comment

Comments

@tbbuck
Copy link

tbbuck commented Aug 17, 2022

Hi!

The documentation says that readings will only be deleted if an HTTP endpoint replies with a 200 status code.

My Python's a bit rusty, should line 34 be indented? Looks like readings are deleted no matter what status code is returned :-o

if result.status_code != 200:
logging.error(f" - failed to upload '{cache_file}' ({result.status_code} {result.reason})", cache_file)
else:
logging.info(f" - uploaded {cache_file}")
os.remove(f"uploads/{cache_file}")

(keep up the good work, loving my Enviro!)

EDIT: aha, looks like this pull request fixes things, including possibly a second issue I was investigating (requests fail after sending 3 readings): #15

@lowfatcode
Copy link
Member

This has been fixed - thanks for pointing it out! cafed06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants