refactor: replace DefaultLimitOffsetPage with LimitOffsetPage in multiple files and update timezone handling to use UTC
This commit is contained in:
@@ -738,7 +738,7 @@ def _should_include_bootstrap(
|
||||
if not existing_files:
|
||||
return False
|
||||
entry = existing_files.get("BOOTSTRAP.md")
|
||||
return not (entry and entry.get("missing") is True)
|
||||
return not bool(entry and entry.get("missing"))
|
||||
|
||||
|
||||
async def _set_agent_files(
|
||||
@@ -753,7 +753,7 @@ async def _set_agent_files(
|
||||
continue
|
||||
if name in PRESERVE_AGENT_EDITABLE_FILES:
|
||||
entry = existing_files.get(name)
|
||||
if entry and entry.get("missing") is not True:
|
||||
if entry and not bool(entry.get("missing")):
|
||||
continue
|
||||
try:
|
||||
await openclaw_call(
|
||||
|
||||
@@ -117,20 +117,20 @@ def _has_cycle(nodes: Sequence[UUID], edges: Mapping[UUID, set[UUID]]) -> bool:
|
||||
visited: set[UUID] = set()
|
||||
in_stack: set[UUID] = set()
|
||||
|
||||
def dfs(node: UUID) -> bool:
|
||||
if node in in_stack:
|
||||
def dfs(current: UUID) -> bool:
|
||||
if current in in_stack:
|
||||
return True
|
||||
if node in visited:
|
||||
if current in visited:
|
||||
return False
|
||||
visited.add(node)
|
||||
in_stack.add(node)
|
||||
for nxt in edges.get(node, set()):
|
||||
visited.add(current)
|
||||
in_stack.add(current)
|
||||
for nxt in edges.get(current, set()):
|
||||
if dfs(nxt):
|
||||
return True
|
||||
in_stack.remove(node)
|
||||
in_stack.remove(current)
|
||||
return False
|
||||
|
||||
return any(dfs(node) for node in nodes)
|
||||
return any(dfs(start_node) for start_node in nodes)
|
||||
|
||||
|
||||
async def validate_dependency_update(
|
||||
|
||||
@@ -132,8 +132,8 @@ class _GatewayBackoff:
|
||||
def reset(self) -> None:
|
||||
self._delay_s = self._base_delay_s
|
||||
|
||||
@staticmethod
|
||||
async def _attempt(
|
||||
self,
|
||||
fn: Callable[[], Awaitable[T]],
|
||||
) -> tuple[T | None, OpenClawGatewayError | None]:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user