Why do most files that I import the replit module refuse to terminate. Even if it is imported but goes unused it just hangs indefinitely after successfully running through the whole program. This goes for import replit, and from replit import db.
I recently typed a simple 2 lines of code importing the module and printing in my testdatabase replit:
I then copied the same code to my newer importreplit replit however that one does terminate after 2 seconds which I assume is the time it takes to import the module and so I believe it is working as it should.
Please let me know what is going wrong and the differences between either project because I’ve tried it multiple times and this new importreplit project is the first one that actually terminates.
nvm, it is a problem specifically with importing db.
It’s caused by the update which adds retries to the DB to prevent the code failing in the case that a rate limit is hit. If you don’t expect your code to hit rate limits, run in Shell:
poetry add replit@'~3.2.4,!=3.2.8||>3.5.0'
Remove the ||>3.5.0 if you don’t want the code to start stalling again in the case that a patch for this issue isn’t released in the next update to replit-py.
Or, of course, you could try and create a PR to fix this issue (I’ll try and get to it myself 2023-12-27T00:00:00Z)
because the issue doesn’t occur if your database is empty.
So, this is undefined behaviour and not just a change we should all be expected to “deal with”.