File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 55
66import pickle
77import os
8+ import requests .exceptions
9+ import time
810
911from github import Github
1012
3840 p .update ()
3941
4042with open ("pr-data.p" , "wb" ) as f :
41- pickle .dump (prs , f )
43+ for i , p in enumerate (prs ):
44+ for retry in range (0 , 9 ):
45+ try :
46+ g .dump (p , f )
47+ break
48+ except requests .exceptions .ReadTimeout :
49+ delay = 2 ** retry
50+ print (f"timeout; sleeping { delay } s and retrying..." )
51+ time .sleep (2 ** delay )
52+ print (f"saved { i + 1 } /{ len (prs )} " )
Original file line number Diff line number Diff line change 66import pickle
77import datetime
88import os
9+ from github import Github
910
11+ prs = []
1012with open ("pr-data.p" , "rb" ) as f :
11- prs = pickle .load (f )
12-
13+ g = Github ()
14+ try :
15+ while True :
16+ prs .append (g .load (f ))
17+ except EOFError :
18+ pass
1319
1420# Current and past core contributors, alphabetical order (sort -f).
1521#
You can’t perform that action at this time.
0 commit comments