wnstnb commited on
Commit
ab52efb
·
1 Parent(s): 2d07d97

getting tests

Browse files
Files changed (3) hide show
  1. lambda_function.py +3 -3
  2. run_app.sh +5 -0
  3. run_test_cron.sh +5 -0
lambda_function.py CHANGED
@@ -110,15 +110,15 @@ def lambda_handler(periods_30m):
110
 
111
  if __name__ == '__main__':
112
  # Code that, based on the time of the day, return which data/model to run
113
- game_time = is_trading_day_and_time()
114
- refresh_time = is_refresh_time()
115
  if game_time:
116
  now = datetime.datetime.now()
117
  # Change this for debugging -- should be EST
118
  morning_start = datetime.datetime.combine(now.date(), time(9, 30))
119
  delta = now - morning_start
120
  print(delta)
121
- intervals = max(0,min((delta.total_seconds() / 60 / 30) // 1, 12))
122
  print(f'running for {str(intervals)}')
123
  j = lambda_handler(intervals)
124
  elif refresh_time:
 
110
 
111
  if __name__ == '__main__':
112
  # Code that, based on the time of the day, return which data/model to run
113
+ game_time = False # is_trading_day_and_time()
114
+ refresh_time = True # is_refresh_time()
115
  if game_time:
116
  now = datetime.datetime.now()
117
  # Change this for debugging -- should be EST
118
  morning_start = datetime.datetime.combine(now.date(), time(9, 30))
119
  delta = now - morning_start
120
  print(delta)
121
+ intervals = 7 # max(0,min((delta.total_seconds() / 60 / 30) // 1, 12))
122
  print(f'running for {str(intervals)}')
123
  j = lambda_handler(intervals)
124
  elif refresh_time:
run_app.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ cd /home/ec2-user/gamedayspx_lambda/
4
+ source .env
5
+ python3 lambda_function.py
run_test_cron.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ cd /home/ec2-user/gamedayspx_lambda/
4
+ source .env
5
+ python3 test_db_get.py