File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 33
44"""Get PR data from github and pickle it."""
55
6- import pickle
76import os
7+ import requests .exceptions
8+ import time
89
910from github import Github
1011
3839 p .update ()
3940
4041with open ("pr-data.p" , "wb" ) as f :
41- pickle .dump (prs , f )
42+ for i , p in enumerate (prs ):
43+ for retry in range (0 , 9 ):
44+ try :
45+ g .dump (p , f )
46+ break
47+ except requests .exceptions .ReadTimeout :
48+ delay = 2 ** retry
49+ print (f"timeout; sleeping { delay } s and retrying..." )
50+ time .sleep (2 ** delay )
51+ print (f"saved { i + 1 } /{ len (prs )} " )
Original file line number Diff line number Diff line change 33
44"""PR data an misc common functions."""
55
6- import pickle
76import datetime
87import os
8+ from github import Github
99
10+ prs = []
1011with open ("pr-data.p" , "rb" ) as f :
11- prs = pickle .load (f )
12-
12+ g = Github ()
13+ try :
14+ while True :
15+ prs .append (g .load (f ))
16+ except EOFError :
17+ pass
1318
1419# Current and past core contributors, alphabetical order (sort -f).
1520#
You can’t perform that action at this time.
0 commit comments