summaryrefslogtreecommitdiff
path: root/Code/download_and_map.py
diff options
context:
space:
mode:
authorHui Lan <lanhui@zjnu.edu.cn>2025-08-11 13:38:35 +0800
committerHui Lan <lanhui@zjnu.edu.cn>2025-08-11 13:38:35 +0800
commit9ff8b3390fb5175cf00cbdfac3f4055dbc6f4e30 (patch)
tree9ec25e2eb0f0770fbe941443e303390d551e469b /Code/download_and_map.py
parentf57f6e3c256db8e160fdf40cbba51180803d3124 (diff)
Why the message cannot be received?
Diffstat (limited to 'Code/download_and_map.py')
-rw-r--r--Code/download_and_map.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Code/download_and_map.py b/Code/download_and_map.py
index 6372248..0e8f160 100644
--- a/Code/download_and_map.py
+++ b/Code/download_and_map.py
@@ -391,15 +391,16 @@ def publish(mapped_data_directory):
redis_host = os.getenv('REDIS_HOST', '127.0.0.1')
redis_password = os.getenv('REDIS_PASSWORD', '123456')
r = redis.Redis(host=redis_host, port=6379, password=redis_password, db=0)
+ r.publish(REDIS_CHANNEL, json.dumps({'filename':'REDIS_START.txt', 'data':str(datetime.now())}))
for fname in glob.glob('%s/*_quant.txt' % (mapped_data_directory.rstrip('/'))):
try:
file_basename = os.path.basename(fname)
with open(fname, 'r') as f:
data = f.read()
r.publish(REDIS_CHANNEL, json.dumps({'filename':file_basename, 'data':data}))
- time.sleep(1)
except Exception as e:
r.publish(REDIS_CHANNEL, json.dumps({'filename':'REDIS_ERROR.txt', 'data':str(e)}))
+ time.sleep(1)
## main