Skip to content

Commit 32b1d63

Browse files
committed
Add shutdown for weight syncer
1 parent e0fe131 commit 32b1d63

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

validator.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from apex.services.deep_research.deep_research_langchain import DeepResearchLangchain
1111
from apex.services.llm.llm import LLM
1212
from apex.services.websearch.websearch_tavily import WebSearchTavily
13-
from apex.validator.auto_update import autoupdate_loop
1413
from apex.validator.logger_db import LoggerDB
1514
from apex.validator.miner_sampler import MinerSampler
1615
from apex.validator.miner_scorer import MinerScorer
@@ -28,12 +27,6 @@ async def read_args() -> argparse.Namespace:
2827
help="Config file path (e.g. config/mainnet.yaml).",
2928
type=Path,
3029
)
31-
parser.add_argument(
32-
"--no-autoupdate",
33-
action="store_true",
34-
default=False,
35-
help="Disable automatic updates (checks every hour) (default: enabled)",
36-
)
3730
args = parser.parse_args()
3831
return args
3932

@@ -73,12 +66,6 @@ async def main() -> None:
7366
asyncio.create_task(miner_scorer.start_loop())
7467
logger.debug(f"Started miner scorer with interval={miner_scorer.interval}")
7568

76-
# Start autoupdate task if enabled
77-
autoupdate_task = None
78-
if not args.no_autoupdate:
79-
logger.info("Autoupdate enabled - will check for updates every hour")
80-
autoupdate_task = asyncio.create_task(autoupdate_loop())
81-
8269
llm = LLM(**config.llm.kwargs)
8370
logger.debug("Started LLM provider")
8471

@@ -101,17 +88,10 @@ async def main() -> None:
10188
except BaseException as exc:
10289
logger.exception(f"Unknown exception caught, exiting validator: {exc}")
10390
finally:
104-
# Cancel autoupdate task if it was started
105-
if autoupdate_task is not None:
106-
autoupdate_task.cancel()
107-
try:
108-
await autoupdate_task
109-
except asyncio.CancelledError:
110-
pass
111-
11291
await chain.shutdown()
11392
await logger_db.shutdown()
11493
await miner_scorer.shutdown()
94+
await weight_syncer.shutdown()
11595

11696

11797
if __name__ == "__main__":

0 commit comments

Comments
 (0)