Saturday work. Needed to fix some Anthology enrollments for their internal employees to wrote a new script to remove everyone from their current groups and bulk re-enroll into all the correct groups and courses.

This commit is contained in:
Norm Rasmussen
2024-02-03 16:54:38 -05:00
parent a9126a355f
commit e46883c0f8
4 changed files with 345 additions and 1 deletions

29
Scripts/queue_test.py Normal file
View File

@ -0,0 +1,29 @@
import threading
import queue
import time
q = queue.Queue()
# def worker():
# while True:
# item = q.get()
# print(f'Working on {item}')
# time.sleep(1)
# print(f'Finished {item}')
# time.sleep(1)
# q.task_done()
#
# # Turn-on the worker thread.
# threading.Thread(target=worker, daemon=True).start()
#
# Send thirty task requests to the worker.
for item in range(30):
print(f'Working on {item}')
time.sleep(1)
print(f'Finished {item}')
time.sleep(1)
# q.put(item)
# Block until all tasks are done.
# q.join()
print('All work completed')