(20260217) Ready to test on production now
This commit is contained in:
+1
-1
@@ -721,7 +721,7 @@ async def sync_attendance_to_tcaoff(
|
||||
yield lst[i:i + size]
|
||||
|
||||
count = 0
|
||||
for chunk in chunks(tasks[:], size = 100):
|
||||
for chunk in chunks(tasks[:], size = 10):
|
||||
count += 1
|
||||
printer("Task Chunk:", count)
|
||||
_res = await asyncio.gather(*chunk)
|
||||
|
||||
+19
-3
@@ -284,7 +284,7 @@ async def set_scheduler(
|
||||
await yesterday_cron(
|
||||
cosec_creds = copy.deepcopy(cosec_creds),
|
||||
tcaoff_client = tcaoff_client,
|
||||
# test_mode = test_mode
|
||||
test_mode = test_mode
|
||||
)
|
||||
await today_cron(
|
||||
cosec_creds = copy.deepcopy(cosec_creds),
|
||||
@@ -342,6 +342,21 @@ async def set_scheduler(
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# Parse args:
|
||||
import argparse
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument(
|
||||
"--test",
|
||||
action = "store_true",
|
||||
default = False,
|
||||
)
|
||||
ap.add_argument(
|
||||
"--verbose",
|
||||
action = "store_true",
|
||||
default = False,
|
||||
)
|
||||
args = ap.parse_args()
|
||||
|
||||
# Explicitly mention the expected file paths for other devs to maintain:
|
||||
print("PROJ. DIR. :", common.PROJ_DIR)
|
||||
print("COSEC CREDS :", common.COSEC_CREDS_FILE)
|
||||
@@ -355,12 +370,13 @@ if __name__ == "__main__":
|
||||
tcaoff_client = AsyncTheCAOffice(
|
||||
username = tcaoff_creds["creds"]["username"],
|
||||
password = tcaoff_creds["creds"]["password"],
|
||||
debug_only_errors = False
|
||||
debug = True,
|
||||
debug_only_errors = False if args.verbose else True,
|
||||
)
|
||||
|
||||
# Schedule the activities:
|
||||
asyncio.run(set_scheduler(
|
||||
cosec_creds = cosec_creds,
|
||||
tcaoff_client = tcaoff_client,
|
||||
test_mode = False
|
||||
test_mode = args.test
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user