mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-11 12:17:45 +02:00
[Haik]: renamed registry_refresh_loop folder to RegistryRefreshLoop. Also created a SkillStore folder containing the relevant content so both singeltons are roughly organized the same
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ from typing import Optional
|
||||
from typeguard import typechecked
|
||||
from pydantic import BaseModel, Field, InstanceOf
|
||||
|
||||
from backend.apps.skills.registry_refresh_loop.fetch_all_registry_skills.fetch_all_registry_skills import fetch_all_registry_skills
|
||||
from backend.apps.skills.RegistryRefreshLoop.fetch_all_registry_skills.fetch_all_registry_skills import fetch_all_registry_skills
|
||||
|
||||
|
||||
class RegistryRefreshLoop(BaseModel):
|
||||
+2
-2
@@ -5,8 +5,8 @@
|
||||
import asyncio
|
||||
import httpx
|
||||
from typeguard import typechecked
|
||||
from backend.apps.skills.registry_refresh_loop.fetch_all_registry_skills.utils.fetch_skill_paths import fetch_skill_paths
|
||||
from backend.apps.skills.registry_refresh_loop.fetch_all_registry_skills.utils.fetch_one_skill import fetch_one_skill
|
||||
from backend.apps.skills.RegistryRefreshLoop.fetch_all_registry_skills.utils.fetch_skill_paths import fetch_skill_paths
|
||||
from backend.apps.skills.RegistryRefreshLoop.fetch_all_registry_skills.utils.fetch_one_skill import fetch_one_skill
|
||||
|
||||
|
||||
@typechecked
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
from backend.apps.skills.Skill import Skill
|
||||
from backend.apps.skills.SkillStore.Skill import Skill
|
||||
from typeguard import typechecked
|
||||
from pydantic import BaseModel
|
||||
import os
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
|
||||
|
||||
import asyncio
|
||||
from datetime import time
|
||||
|
||||
from typeguard import typechecked
|
||||
from backend.apps.skills.registry_refresh_loop.fetch_all_registry_skills.fetch_all_registry_skills import fetch_all_registry_skills
|
||||
|
||||
@typechecked
|
||||
async def registry_refresh_loop(
|
||||
# Args needed for the loop
|
||||
refresh_interval_s: int,
|
||||
registry_cache: dict[str, dict],
|
||||
registry_updated_at: float,
|
||||
# Args needed for fetch_all_registry_skills
|
||||
num_concurrent_fetches: int,
|
||||
manifest_url: str,
|
||||
raw_base: str,
|
||||
repo: str,
|
||||
branch: str,
|
||||
) -> None:
|
||||
while True:
|
||||
try:
|
||||
registry_cache = await fetch_all_registry_skills(
|
||||
num_concurrent_fetches=num_concurrent_fetches,
|
||||
manifest_url=manifest_url,
|
||||
raw_base=raw_base,
|
||||
repo=repo,
|
||||
branch=branch,
|
||||
)
|
||||
registry_updated_at = time.time()
|
||||
except Exception as e:
|
||||
print(f"[registry_refresh_loop] Skill registry refresh error: {e}")
|
||||
await asyncio.sleep(refresh_interval_s)
|
||||
@@ -11,9 +11,9 @@ from pydantic import BaseModel
|
||||
|
||||
from backend.config.Apps import SubApp
|
||||
from backend.config.paths import DB_ROOT
|
||||
from backend.apps.skills.SkillStore import SkillStore
|
||||
from backend.apps.skills.SkillStore.SkillStore import SkillStore
|
||||
from backend.apps.skills.parse_frontmatter import parse_frontmatter
|
||||
from backend.apps.skills.registry_refresh_loop.RegistryRefreshLoop import RegistryRefreshLoop
|
||||
from backend.apps.skills.RegistryRefreshLoop.RegistryRefreshLoop import RegistryRefreshLoop
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user