Skip to content

Commit 5fa31c7

Browse files
committed
Allow config override for backup constants
1 parent 991f309 commit 5fa31c7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

rqd/rqd/rqconstants.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164

165165
# Backup running frames cache. Backup cache is turned off if this path is set to
166166
# None or ""
167-
BACKUP_CACHE_PATH = "/tmp/opencue/running_frames_backup.dat"
167+
BACKUP_CACHE_PATH = ""
168168
BACKUP_CACHE_TIME_TO_LIVE_SECONDS = 60
169169

170170
try:
@@ -248,6 +248,11 @@
248248
if config.has_section(__host_env_var_section):
249249
RQD_HOST_ENV_VARS = config.options(__host_env_var_section)
250250

251+
if config.has_option(__override_section, "BACKUP_CACHE_PATH"):
252+
BACKUP_CACHE_PATH = config.get(__override_section, "BACKUP_CACHE_PATH")
253+
if config.has_option(__override_section, "BACKUP_CACHE_TIME_TO_LIVE_SECONDS"):
254+
BACKUP_CACHE_TIME_TO_LIVE_SECONDS = config.get(__override_section, "BACKUP_CACHE_TIME_TO_LIVE_SECONDS")
255+
251256
__docker_mounts = "docker.mounts"
252257
__docker_config = "docker.config"
253258
__docker_images = "docker.images"

rqd/rqd/rqcore.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def __init__(self, optNimbyoff=False):
113113
self.backup_cache_path = rqd.rqconstants.BACKUP_CACHE_PATH
114114
if not os.path.exists(os.path.dirname(self.backup_cache_path)):
115115
os.makedirs(os.path.dirname(self.backup_cache_path))
116+
self.recoverCache()
116117

117118
signal.signal(signal.SIGINT, self.handleExit)
118119
signal.signal(signal.SIGTERM, self.handleExit)
@@ -232,6 +233,7 @@ def recoverCache(self):
232233
# Ignore frames that failed to be parsed
233234
try:
234235
run_frame.ParseFromString(message_data)
236+
log.warning("Recovered frame %s.%s", run_frame.job_name, run_frame.frame_name)
235237
running_frame = rqd.rqnetwork.RunningFrame(self, run_frame)
236238
running_frame.frameAttendantThread = FrameAttendantThread(
237239
self, run_frame, running_frame, recovery_mode=True)

0 commit comments

Comments
 (0)