Better process pool..

This commit is contained in:
retoor 2024-12-14 06:33:04 +01:00
parent fc50e6cd4e
commit d501aa5076
3 changed files with 23 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
import argparse import argparse
import random import random
import time import time
from concurrent.futures import ThreadPoolExecutor as Executor from concurrent.futures import ProcessPoolExecutor as Executor
from ragnar import log from ragnar import log
from ragnar.bot import Bot from ragnar.bot import Bot
@ -31,6 +31,7 @@ def bot_task(username, password):
def main(): def main():
args = parse_args() args = parse_args()
<<<<<<< HEAD
with Executor(500) as executor: with Executor(500) as executor:
usernames = [ usernames = [
# "no-spam1", # "no-spam1",
@ -49,6 +50,27 @@ def main():
"AmandaFloyd", "AmandaFloyd",
] ]
for username in usernames: for username in usernames:
=======
usernames = [
# "no-spam1",
# "no-spam2",
# "no-spam3",
# "no-spam4",
# "no-spam",
"no-spam2353",
"no-spam2351",
"no-spam2350",
"no-spam2349",
"JamesMedina",
"MichelleWeeks",
"JaredRuiz",
"LoriMcgee",
"AmandaFloyd"
]
with Executor(len(usernammes) + 1) as executor:
for username in usernames:
>>>>>>> bd8abd5 (Better process pool..)
executor.submit(bot_task, f"{username}@molodetz.nl", args.password) executor.submit(bot_task, f"{username}@molodetz.nl", args.password)
executor.shutdown(wait=True) executor.shutdown(wait=True)