Files
decomp.me/backend/coreapp/util.py
ConorB 906aa4a8a8 Switch timeout mechanism to subprocess.run (#659)
* Switch to subprocess.run for timeouts

* [experiment] Set CI TIMEOUT_SCALE_FACTOR to 1

* supress parameterized.expand error in event of no compilers, change TIMEOUT_SCALE_FACTOR in CI to 2

* Exempt dummy compilers from nsjail bind mounts, disable nsjail time limits

* Don't run timeout test on windows

* Decouple test_compiler_timeout's timeout from global timeout settings, reset TIMEOUT_SCALE_FACTOR to 10

* Have DummyLongRunningCompiler subclass DummyCompiler

* Have a timeout of zero disable timeouts entirely

* Skip test_zero_timeout on windows

* black

Co-authored-by: ConorBobbleHat <c.github@firstpartners.net>
2023-01-21 03:04:27 +09:00

15 lines
315 B
Python

import hashlib
import logging
import time
from typing import Tuple
logger = logging.getLogger(__name__)
_startup_time = int(time.time())
logger.info("Startup time: %s", _startup_time)
def gen_hash(key: Tuple[str, ...]) -> str:
return hashlib.sha256(str(key + (_startup_time,)).encode("utf-8")).hexdigest()