Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/model.py
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | class ListedOrigin(BaseSchedulerModel): | ||||
) | ) | ||||
last_seen = attr.ib( | last_seen = attr.ib( | ||||
type=Optional[datetime.datetime], | type=Optional[datetime.datetime], | ||||
validator=[type_validator()], | validator=[type_validator()], | ||||
default=None, | default=None, | ||||
metadata={"auto_now": True}, | metadata={"auto_now": True}, | ||||
) | ) | ||||
def as_task_dict(self): | |||||
return { | |||||
"type": f"load-{self.visit_type}", | |||||
"arguments": { | |||||
"args": [], | |||||
"kwargs": {"url": self.url, **self.extra_loader_arguments}, | |||||
}, | |||||
} | |||||
class LastVisitStatus(Enum): | class LastVisitStatus(Enum): | ||||
successful = "successful" | successful = "successful" | ||||
failed = "failed" | failed = "failed" | ||||
not_found = "not_found" | not_found = "not_found" | ||||
def convert_last_visit_status( | def convert_last_visit_status( | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |