Skip to content

Conversation

@nomecks
Copy link

@nomecks nomecks commented Feb 4, 2021

if diff_dates(strUpdate, now) < int(intHours):

This line breaks things, as intHours is in seconds and strUpdate and now are both in epoch time. Even if intHours was in the correct format all this does is make old alerts occur if they're over 24 hours old.

You need a try statement around isItemResponse = response.get('Item'), as if the item isn't in the database it'll throw an error because response.get is invalid for NoneType.

I also fixed an indent error for the last else statement.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

if diff_dates(strUpdate, now) < int(intHours):

This line breaks things, as intHours is in seconds and strUpdate and now are both in epoch time. Even if intHours was in the correct format all this does is make old alerts occur if they're over 24 hours old.

You need a try statement around isItemResponse = response.get('Item'), as if the item isn't in the database it'll throw an error because response.get is invalid for NoneType.

I also fixed an indent error for the last else statement.
Added another else: to the end to log no action events.
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

Successfully merging this pull request may close these issues.

1 participant