-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3da9da8
commit ae7fec7
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
def get_last_status_codes(checks): | ||
result = {} | ||
|
||
for item in checks: | ||
id = item['id'] | ||
url_id = item['url_id'] | ||
|
||
if url_id not in result or result.get(url_id, {}).get('id', -1) < id: | ||
result[url_id] = { | ||
'id': id, | ||
'status_code': item['status_code'], | ||
'created_at': item['created_at'] | ||
} | ||
|
||
return result | ||
|