blob: 982eb3eef2bc0a0fb49e7aaa55e872e24529f575 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import redis
from pickle import dumps
import datetime
import os
import time
if os.name =='nt':
root = "//WDsentinel/share/CorpCDOs"
elif os.name == 'posix':
root = '/home/share/CorpCDOs'
dealsfile = os.path.join(root, "scripts", "deals_to_price.txt")
q = redis.Redis(unix_socket_path='/var/run/redis/redis.sock')
workdate = str(datetime.date.today())
while True:
if os.path.exists(dealsfile):
with open(dealsfile) as fh:
for line in fh:
dealname, reinvflag = line.rstrip().split("\t")
q.rpush("tasks", dumps(("build_portfolio", [workdate, dealname, reinvflag])))
os.unlink(dealsfile)
time.sleep(3)
|