Skip to content

Commit

Permalink
update fn
Browse files Browse the repository at this point in the history
  • Loading branch information
ericz1803 committed Aug 11, 2023
1 parent 865a5ca commit ff47327
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package:

functions:
run-rebalance:
handler: src/lambda_function.lambda_handler
handler: src/main.main

plugins:
- serverless-python-requirements
Expand Down
6 changes: 0 additions & 6 deletions src/lambda_function.py

This file was deleted.

9 changes: 7 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ def rebalance(self):
)

print(f"Attempted to buy ${total_spent} worth of stocks.")


def getTrader():
global trader
if not trader:
trader = Trader()
return trader

def main():
trader = Trader()
trader = getTrader()
trader.rebalance()

if __name__ == '__main__':
Expand Down

0 comments on commit ff47327

Please sign in to comment.