mirror of
https://github.com/ioistired/pleroma-ebooks.git
synced 2024-11-20 02:14:52 +01:00
fixed another possibility for the bots to get stuck
This commit is contained in:
parent
f39fbc9c67
commit
33ea8fe830
@ -29,8 +29,10 @@ def make_sentence(output):
|
|||||||
os.remove("toots-copy.db")
|
os.remove("toots-copy.db")
|
||||||
|
|
||||||
sentence = None
|
sentence = None
|
||||||
while sentence is None:
|
tries = 0
|
||||||
|
while sentence is None and tries < 10:
|
||||||
sentence = model.make_short_sentence(500, tries=10000)
|
sentence = model.make_short_sentence(500, tries=10000)
|
||||||
|
tries = tries + 1
|
||||||
sentence = re.sub("^@\u202B[^ ]* ", "", sentence)
|
sentence = re.sub("^@\u202B[^ ]* ", "", sentence)
|
||||||
output.send(sentence)
|
output.send(sentence)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user