File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1300,12 +1300,9 @@ def path(self) -> Path:
13001300
13011301def _try_best_effort_sync ():
13021302 """
1303- Attempt to sync registries on first import .
1303+ Attempt to sync registries (best-effort, fails silently) .
13041304
1305- This is a best-effort operation - if it fails (network issues,
1306- misconfiguration, etc.), we silently continue. The user will get
1307- a clear error message if they try to use the registry without
1308- having synced successfully.
1305+ Called by consumer commands before accessing model registries.
13091306 """
13101307 global _SYNC_ATTEMPTED
13111308
@@ -1323,10 +1320,6 @@ def _try_best_effort_sync():
13231320 pass
13241321
13251322
1326- # Try to sync on first import (unless disabled)
1327- if not os .environ .get ("MODFLOW_DEVTOOLS_NO_AUTO_SYNC" ):
1328- _try_best_effort_sync ()
1329-
13301323# Lazy initialization of default registry
13311324_default_registry_cache = None
13321325
Original file line number Diff line number Diff line change 88"""
99
1010import argparse
11+ import os
1112import sys
1213
1314from . import (
1415 _DEFAULT_CACHE ,
1516 ModelSourceConfig ,
17+ _try_best_effort_sync ,
1618)
1719
1820
@@ -78,6 +80,10 @@ def cmd_sync(args):
7880
7981def cmd_info (args ):
8082 """Info command handler."""
83+ # Attempt auto-sync before showing info (unless disabled)
84+ if not os .environ .get ("MODFLOW_DEVTOOLS_NO_AUTO_SYNC" ):
85+ _try_best_effort_sync ()
86+
8187 config = ModelSourceConfig .load ()
8288 status = config .status
8389
@@ -96,6 +102,10 @@ def cmd_info(args):
96102
97103def cmd_list (args ):
98104 """List command handler."""
105+ # Attempt auto-sync before listing (unless disabled)
106+ if not os .environ .get ("MODFLOW_DEVTOOLS_NO_AUTO_SYNC" ):
107+ _try_best_effort_sync ()
108+
99109 cached = _DEFAULT_CACHE .list ()
100110
101111 if not cached :
You can’t perform that action at this time.
0 commit comments