Skip to content

Commit b58b283

Browse files
Forcing REDIS_URL to be there
1 parent 58409f0 commit b58b283

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

update.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99

1010
print("Updating securities data in Redis....")
1111

12-
# Read in the environment
13-
environment = os.getenv('FLASK_ENV', 'DEVELOPMENT')
14-
config_file_path = os.path.join(os.path.dirname(__file__), 'config', 'config.yml')
15-
f = open(config_file_path, "r")
16-
environment_data = yaml.safe_load(f)
17-
f.close()
18-
1912
# Loads the overall assets/securities, not the individual etfs
2013
assets = load_json_data.get_assets()
2114
tickers = [ el['representative_ticker'] for el in assets ]
@@ -27,7 +20,7 @@
2720
mean_returns, std_dev_returns, covariance_matrix = stats.generate_stats(prices)
2821

2922
# Save data to redis
30-
redis_url = os.getenv('REDIS_URL', environment_data[environment]['REDIS_URL'])
23+
redis_url = os.getenv('REDIS_URL')
3124
redis_conn = redis.StrictRedis.from_url(redis_url)
3225
save_data.write_redis_data(redis_conn, mean_returns, std_dev_returns, covariance_matrix)
3326

0 commit comments

Comments
 (0)