feat: add filelock back
All checks were successful
build / trigger-build-image (push) Successful in 47s

This commit is contained in:
张泊明518370910136 2025-10-25 09:05:23 -07:00
parent 3a511660bb
commit f4fb5eae05
GPG Key ID: CA088E6D9284F870
2 changed files with 3 additions and 4 deletions

View File

@ -6,7 +6,7 @@ from pathlib import Path
from time import sleep
from typing import TYPE_CHECKING, List, Optional
# from filelock import FileLock
from filelock import FileLock
from git import Repo
from typer import Argument, Exit, Option, Typer, echo
@ -392,8 +392,7 @@ def joj3_all_env(
f"try to acquire lock, file path: {lock_file_path}, "
+ f"timeout: {settings.joj3_lock_file_timeout}"
)
if True: # disable the file lock temporarily
# with FileLock(lock_file_path, timeout=settings.joj3_lock_file_timeout).acquire():
with FileLock(lock_file_path, timeout=settings.joj3_lock_file_timeout).acquire():
logger.info("file lock acquired")
retry_interval = 1
git_push_ok = False

View File

@ -40,7 +40,7 @@ class Settings(BaseSettings):
joj_sid: str = ""
# joj3
joj3_lock_file_path: str = ".git/teapot.lock"
joj3_lock_file_path: str = ".git/teapot-joj3-all-env.lock"
joj3_lock_file_timeout: int = 30
# moss