chore: better logs
All checks were successful
build / trigger-build-image (push) Successful in 14s

This commit is contained in:
张泊明518370910136 2025-11-30 00:25:30 -08:00
parent 128142e965
commit 71414ef9c9
GPG Key ID: CA088E6D9284F870
2 changed files with 5 additions and 7 deletions

View File

@ -389,12 +389,12 @@ def joj3_all_env(
lock_file_path = os.path.join(
settings.repos_dir, grading_repo_name, settings.joj3_lock_file_path
)
logger.info(
logger.debug(
f"try to acquire lock, file path: {lock_file_path}, "
+ f"timeout: {settings.joj3_lock_file_timeout}"
)
with FileLock(lock_file_path, timeout=settings.joj3_lock_file_timeout).acquire():
logger.info("file lock acquired")
logger.debug("file lock acquired")
retry_interval = 1
git_push_ok = False
while not git_push_ok:

View File

@ -105,8 +105,8 @@ class Git:
os.remove(lock_file_path)
locks_removed_count += 1
except OSError as e:
logger.warning(f"Error removing lock file: {e}")
logger.info(f"Removed {locks_removed_count} lock files")
logger.warning(f"error removing lock file: {e}")
logger.info(f"removed {locks_removed_count} lock files")
repo.git.fetch("--tags", "--all", "-f")
repo.git.reset("--hard", reset_target)
repo.git.clean("-d", "-f", "-x")
@ -143,9 +143,7 @@ class Git:
try:
repo.index.add(file)
except OSError:
logger.warning(
f'File path "{file}" does not exist. Skipping this file.'
)
logger.warning(f'file path "{file}" does not exist, skipped')
continue
if repo.is_dirty(untracked_files=True) or repo.index.diff(None):
repo.index.commit(commit_message)