fix(datastore): increase backend probe timeout to 3s and rebase before push
This commit is contained in:
@@ -124,7 +124,7 @@ class DatastoreEngine:
|
||||
base = self.backend_url.replace("/duckdb-api/v1", "")
|
||||
test_url = f"{base}/healthz"
|
||||
req = urllib.request.Request(test_url, method="GET")
|
||||
with urllib.request.urlopen(req, timeout=1.0) as r:
|
||||
with urllib.request.urlopen(req, timeout=3.0) as r:
|
||||
if r.status == 200:
|
||||
self.use_backend = True
|
||||
logger.info(f"DatastoreEngine using single-writer backend at {self.backend_url}")
|
||||
@@ -505,7 +505,8 @@ class DatastoreEngine:
|
||||
subprocess.run(["git", "-C", str(repo_dir), "add", str(self.data_dir)], check=False, capture_output=True)
|
||||
res = subprocess.run(["git", "-C", str(repo_dir), "commit", "-m", f"{commit_msg} [skip ci]"], check=False, capture_output=True)
|
||||
if res.returncode == 0:
|
||||
subprocess.run(["git", "-C", str(repo_dir), "push", "origin", "main"], check=False, capture_output=True, timeout=10)
|
||||
subprocess.run(["git", "-C", str(repo_dir), "pull", "--rebase", "--autostash", "origin", "main"], check=False, capture_output=True, timeout=20)
|
||||
subprocess.run(["git", "-C", str(repo_dir), "push", "origin", "main"], check=False, capture_output=True, timeout=20)
|
||||
except Exception as e:
|
||||
logger.debug(f"Git auto-sync skipped/failed: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user