Skip to content

Commit

Permalink
Add expiry date to cal solution hashes in Redis to save space.
Browse files Browse the repository at this point in the history
Need to decide how to handle the zset index entries.
  • Loading branch information
danielczech committed Jan 20, 2025
1 parent 844787c commit b365f8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coordinator/telstate_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def format_cals(self, product_id, cal_K, cal_G, cal_B, cal_all, nants, ants, nch
"nants":nants, "antenna_list":str(ants), "nchan":nchans,
"refant":refant, "script_ts":timestamp, "retrieval_ts":r_t}
self.red.hmset(hash_key, hash_dict)
# Expire after 30 days to save space
self.red.expire(hash_key, 2592000)
# Save to index (zset)
index_name = "{}:cal_solutions:index".format(product_id)
log.info("Saving into Redis zset index: {}".format(index_name))
Expand Down

0 comments on commit b365f8c

Please sign in to comment.