Bot into main #71

Merged
NormalParameter merged 55 commits from bot into main 2022-04-25 15:02:35 +00:00
Showing only changes of commit 27858a3b59 - Show all commits

View File

@ -263,7 +263,20 @@ class API_Handler:
else:
return self.get_user_portfolio(user_id, max_retries-1)
def set_cron_interval(self, user_id, cron_interval):
"""sets the cron interval of the user
Args:
user_id (int): id of the user
cron_interval (String): Update interval in cron format => see https://crontab.guru/ for formatting
Returns:
int: status code
"""
with r.Session() as s:
headers = {'Authorization': 'Bearer ' + self.token + ":" + str(user_id)}
req = s.put(self.db_adress + "/user/setCron", json={"cron": cron_interval}, headers=headers)
return req.status_code
if __name__ == "__main__":