Skip to content

Commit

Permalink
Salvage fastchess binary after worker update.
Browse files Browse the repository at this point in the history
Raise worker version to 253 (also server side).
  • Loading branch information
vdbergh authored and ppigazzini committed Jan 21, 2025
1 parent 6d6dde3 commit e92b1d9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/fishtest/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
according to the route/URL mapping defined in `__init__.py`.
"""

WORKER_VERSION = 252
WORKER_VERSION = 253


@exception_view_config(HTTPException)
Expand Down
2 changes: 1 addition & 1 deletion worker/sri.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"__version": 252, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "JHO7pc2YF9noh8wsc1Pxmtd9x9zG8Hr+0haT7HEAvsCR1wYzUAYCUk7bWT/BJqOX", "games.py": "IZmJeczQV7IDMOvWS1NqR/tPe+Zg3rI8D1QDYIz/dvRE8auUU66PEjyfhWf9nbNe"}
{"__version": 253, "updater.py": "KiNaNadQJzjX85e2joCkfy87KUWIHizx+80xiFWMF7G7av2rDQaRrawnvhIjn9tL", "worker.py": "A3XMZNXEhv4Vi3qZYG6ZPBNROtWWiX4s8tmHCUD9bqxR9vmddPBOqvsF/Tfxu7w7", "games.py": "IZmJeczQV7IDMOvWS1NqR/tPe+Zg3rI8D1QDYIz/dvRE8auUU66PEjyfhWf9nbNe"}
16 changes: 16 additions & 0 deletions worker/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from zipfile import ZipFile

import requests
from games import EXE_SUFFIX

start_dir = Path().cwd()

Expand Down Expand Up @@ -112,6 +113,21 @@ def update(restart=True, test=False):
sep="",
file=sys.stderr,
)
# Salvage fastchess binary
fastchess_binary = Path("fastchess" + EXE_SUFFIX)
old_fast_chess = bkp_testing_dir / fastchess_binary
if old_fast_chess.exists():
new_fast_chess = testing_dir / fastchess_binary
try:
old_fast_chess.replace(new_fast_chess)
except Exception as e:
print(
"Failed to preserve fastchess binary:\n",
e,
sep="",
file=sys.stderr,
)

# Clean up old folder backups (keeping the num_bkps most recent).
num_bkps = 3
for old_bkp_dir in sorted(
Expand Down
2 changes: 1 addition & 1 deletion worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
MIN_CLANG_MAJOR = 8
MIN_CLANG_MINOR = 0

WORKER_VERSION = 252
WORKER_VERSION = 253
FILE_LIST = ["updater.py", "worker.py", "games.py"]
HTTP_TIMEOUT = 30.0
INITIAL_RETRY_TIME = 15.0
Expand Down

0 comments on commit e92b1d9

Please sign in to comment.