aboutsummaryrefslogtreecommitdiffstats
path: root/python/process_queue.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/process_queue.py')
-rw-r--r--python/process_queue.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/python/process_queue.py b/python/process_queue.py
index d18c15db..325acb77 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -374,18 +374,20 @@ def terminate_list(
conn: psycopg2.extensions.connection,
base_dir: pathlib.Path = DAILY_DIR,
):
- trade_type = key.split("_")[0]
+ trade_type, fund, _ = key.split("_")
for term in p.lrange(key, 0, -1):
termination = loads(term)
try:
- buf, trade_type = build_termination(base_dir, conn, **termination)
+ buf, trade_type = build_termination(
+ base_dir, conn, fund=fund, **termination
+ )
except TypeError as e:
logging.error(e)
return
else:
- dest = get_filepath(base_dir, trade_type, termination["fund"])
+ dest = get_filepath(base_dir, trade_type, fund)
if upload:
- upload_buf(buf, dest.name, termination["fund"])
+ upload_buf(buf, dest.name, fund)
dest.parent.mkdir(exist_ok=True)
dest.write_bytes(buf)
p.delete(key)
@@ -1071,7 +1073,7 @@ if __name__ == "__main__":
)
r.transaction(p_list, key)
for trade_type in ("cds", "swaption", "capfloor"):
- key = f"{trade_type}_termination"
+ key = f"{trade_type}_{args.fund}_termination"
t_list = partial(
terminate_list, key=key, upload=not args.no_upload, conn=dawndb
)