This commit is contained in:
parent
128142e965
commit
71414ef9c9
|
|
@ -389,12 +389,12 @@ def joj3_all_env(
|
||||||
lock_file_path = os.path.join(
|
lock_file_path = os.path.join(
|
||||||
settings.repos_dir, grading_repo_name, settings.joj3_lock_file_path
|
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"try to acquire lock, file path: {lock_file_path}, "
|
||||||
+ f"timeout: {settings.joj3_lock_file_timeout}"
|
+ f"timeout: {settings.joj3_lock_file_timeout}"
|
||||||
)
|
)
|
||||||
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")
|
logger.debug("file lock acquired")
|
||||||
retry_interval = 1
|
retry_interval = 1
|
||||||
git_push_ok = False
|
git_push_ok = False
|
||||||
while not git_push_ok:
|
while not git_push_ok:
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,8 @@ class Git:
|
||||||
os.remove(lock_file_path)
|
os.remove(lock_file_path)
|
||||||
locks_removed_count += 1
|
locks_removed_count += 1
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
logger.warning(f"Error removing lock file: {e}")
|
logger.warning(f"error removing lock file: {e}")
|
||||||
logger.info(f"Removed {locks_removed_count} lock files")
|
logger.info(f"removed {locks_removed_count} lock files")
|
||||||
repo.git.fetch("--tags", "--all", "-f")
|
repo.git.fetch("--tags", "--all", "-f")
|
||||||
repo.git.reset("--hard", reset_target)
|
repo.git.reset("--hard", reset_target)
|
||||||
repo.git.clean("-d", "-f", "-x")
|
repo.git.clean("-d", "-f", "-x")
|
||||||
|
|
@ -143,9 +143,7 @@ class Git:
|
||||||
try:
|
try:
|
||||||
repo.index.add(file)
|
repo.index.add(file)
|
||||||
except OSError:
|
except OSError:
|
||||||
logger.warning(
|
logger.warning(f'file path "{file}" does not exist, skipped')
|
||||||
f'File path "{file}" does not exist. Skipping this file.'
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
if repo.is_dirty(untracked_files=True) or repo.index.diff(None):
|
if repo.is_dirty(untracked_files=True) or repo.index.diff(None):
|
||||||
repo.index.commit(commit_message)
|
repo.index.commit(commit_message)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user