Change logic to launch 4 bots per min
This commit is contained in:
@@ -88,14 +88,16 @@ class DialoutBot:
|
|||||||
phone_numbers = [
|
phone_numbers = [
|
||||||
"+12097135124", # James
|
"+12097135124", # James
|
||||||
"+12097135125", # James
|
"+12097135125", # James
|
||||||
"+19499870006", # Varun
|
self.phone_number,
|
||||||
|
# "+19499870006", # Varun
|
||||||
]
|
]
|
||||||
return phone_numbers[callId % len(phone_numbers)]
|
return phone_numbers[callId % len(phone_numbers)]
|
||||||
else:
|
else:
|
||||||
phone_numbers = [
|
phone_numbers = [
|
||||||
"+14155204406", # James
|
"+14155204406", # James
|
||||||
"+18187229086", # James (Avoca)
|
"+18187229086", # James (Avoca)
|
||||||
"+16673870006", # Varun
|
self.phone_number,
|
||||||
|
# "+16673870006", # Varun
|
||||||
]
|
]
|
||||||
return phone_numbers[callId % len(phone_numbers)]
|
return phone_numbers[callId % len(phone_numbers)]
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ async def run_bot(id: int, run_number: int, bot_run_time: int, phone_number: str
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Create daily.co room with dialin and dialout enabled
|
# Create daily.co room with dialin and dialout enabled
|
||||||
exp = time.time() + bot_run_time
|
exp = time.time() + bot_run_time + 600
|
||||||
room_params = DailyRoomParams(
|
room_params = DailyRoomParams(
|
||||||
properties=DailyRoomProperties(
|
properties=DailyRoomProperties(
|
||||||
exp=exp,
|
exp=exp,
|
||||||
@@ -59,6 +59,7 @@ async def run_bot(id: int, run_number: int, bot_run_time: int, phone_number: str
|
|||||||
[id, "Rate Limit Error", datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]]
|
[id, "Rate Limit Error", datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
await asyncio.sleep(15)
|
||||||
bot_proc = f"python3 -m batch_dialout_bot -u {room.url} -t {token} -i {id} -r {run_number} -p {phone_number}"
|
bot_proc = f"python3 -m batch_dialout_bot -u {room.url} -t {token} -i {id} -r {run_number} -p {phone_number}"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -96,8 +97,8 @@ async def main():
|
|||||||
]
|
]
|
||||||
print(f"-- Number of bots: {len(bots)}")
|
print(f"-- Number of bots: {len(bots)}")
|
||||||
await asyncio.gather(*bots)
|
await asyncio.gather(*bots)
|
||||||
print(f"-- Waiting {bot_run_time + 30} seconds...")
|
print(f"-- Waiting {bot_run_time} seconds...")
|
||||||
await asyncio.sleep(bot_run_time + 30)
|
await asyncio.sleep(bot_run_time)
|
||||||
print(f"-- Finished waiting {bot_run_time} seconds...")
|
print(f"-- Finished waiting {bot_run_time} seconds...")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,41 @@
|
|||||||
bot_id,enable_dialout,timestamp
|
bot_id,enable_dialout,timestamp
|
||||||
0,True,2024-12-10 15:24:10.529
|
0,True,2024-12-20 15:16:38.801
|
||||||
0,True,2024-12-10 15:24:51.754
|
2,True,2024-12-20 15:16:38.804
|
||||||
|
3,True,2024-12-20 15:16:38.835
|
||||||
|
1,True,2024-12-20 15:16:38.940
|
||||||
|
0,True,2024-12-20 15:17:55.016
|
||||||
|
2,True,2024-12-20 15:17:55.038
|
||||||
|
1,True,2024-12-20 15:17:55.102
|
||||||
|
3,True,2024-12-20 15:17:55.174
|
||||||
|
0,True,2024-12-20 15:19:11.256
|
||||||
|
2,True,2024-12-20 15:19:11.294
|
||||||
|
3,True,2024-12-20 15:19:11.320
|
||||||
|
1,True,2024-12-20 15:19:11.336
|
||||||
|
0,True,2024-12-20 15:20:27.439
|
||||||
|
1,True,2024-12-20 15:20:27.461
|
||||||
|
3,True,2024-12-20 15:20:27.465
|
||||||
|
2,True,2024-12-20 15:20:27.472
|
||||||
|
3,True,2024-12-20 15:21:43.567
|
||||||
|
0,True,2024-12-20 15:21:43.592
|
||||||
|
1,True,2024-12-20 15:21:43.606
|
||||||
|
2,True,2024-12-20 15:21:43.750
|
||||||
|
3,True,2024-12-20 15:22:59.818
|
||||||
|
2,True,2024-12-20 15:22:59.825
|
||||||
|
0,True,2024-12-20 15:22:59.844
|
||||||
|
1,True,2024-12-20 15:22:59.853
|
||||||
|
2,True,2024-12-20 15:24:15.971
|
||||||
|
3,True,2024-12-20 15:24:15.976
|
||||||
|
0,True,2024-12-20 15:24:16.035
|
||||||
|
1,True,2024-12-20 15:24:16.099
|
||||||
|
2,True,2024-12-20 15:25:32.202
|
||||||
|
0,True,2024-12-20 15:25:32.223
|
||||||
|
3,True,2024-12-20 15:25:32.276
|
||||||
|
1,True,2024-12-20 15:25:32.334
|
||||||
|
3,True,2024-12-20 15:26:48.410
|
||||||
|
0,True,2024-12-20 15:26:48.449
|
||||||
|
1,True,2024-12-20 15:26:48.504
|
||||||
|
2,True,2024-12-20 15:26:48.540
|
||||||
|
3,True,2024-12-20 15:28:04.604
|
||||||
|
0,True,2024-12-20 15:28:04.604
|
||||||
|
2,True,2024-12-20 15:28:04.614
|
||||||
|
1,True,2024-12-20 15:28:04.648
|
||||||
|
|||||||
|
Reference in New Issue
Block a user