[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:
haikdc
2026-04-05 19:00:18 -07:00
parent b1dbd4bce8
commit 17649e3be2
8 changed files with 6 additions and 41 deletions
@@ -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):
@@ -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)
+2 -2
View File
@@ -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__)