Reduce sleep duration and optimize share emission and purchase logic; add .gitignore for virtual environment

This commit is contained in:
Lukian 2025-01-18 21:36:48 +01:00
parent 05c9f5226e
commit df6417e3ea
3 changed files with 8 additions and 9 deletions

View file

@ -59,9 +59,8 @@ if __name__ == "__main__":
shareholders = getAllBuyers()
shares = getAllShares()
for shareholder in shareholders:
shareId = randint(0, len(shares) - 1)
buyShare(shareholder["id"], shareId, shares[shareId]["price"] + randint(-20, 20))
shareId = randint(0, len(shares) - 1)
buyShare(randint(0, len(shareholders) - 1), shareId, shares[shareId]["price"] + randint(-20, 20))
sleep(30)
sleep(4)