pages: set page status to 200 if unset and loadState != 0 (#1563)

Follow up to #1516, ensure page status is set to 200 if no status is
provided, if loadState is not 0
This commit is contained in:
Ilya Kreymer 2024-02-29 15:15:17 -08:00 committed by GitHub
parent 2ac6584942
commit 09a0d51843
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,6 +70,9 @@ class PageOps:
page_id = uuid4()
try:
status = page_dict.get("status")
if not status and page_dict.get("loadState"):
status = 200
page = Page(
id=page_id,
oid=oid,
@ -77,6 +80,7 @@ class PageOps:
url=page_dict.get("url"),
title=page_dict.get("title"),
load_state=page_dict.get("loadState"),
status=status,
timestamp=(
from_k8s_date(page_dict.get("ts"))
if page_dict.get("ts")