Skip to content

Commit 6d1766c

Browse files
committed
mailbot: retry fetching the lore archive
Various AI data scraping bots are overloading kernel.org Add retries for fetching emails. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent de60422 commit 6d1766c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

mailbot.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,18 @@ def do_mail_delayed(msg, pw, dr):
675675
print("ERROR: message delayed for the second time", str(e))
676676

677677

678+
def fetch_tree(tree):
679+
for _ in range(3):
680+
try:
681+
tree.git_fetch(tree.remote)
682+
return
683+
except:
684+
print('WARNING: git fetch failed, retrying')
685+
time.sleep(300)
686+
687+
678688
def check_new(tree, pw, dr):
679-
tree.git_fetch(tree.remote)
689+
fetch_tree(tree)
680690
hashes = tree.git(['log', "--format=%h", f'..{tree.remote}/{tree.branch}', '--reverse'])
681691
hashes = hashes.split()
682692
for h in hashes:

0 commit comments

Comments
 (0)