File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 46
46
- name : Build Pandas
47
47
uses : ./.github/actions/build_pandas
48
48
49
+ - name : Set up maintainers cache
50
+ uses : actions/cache@v3
51
+ with :
52
+ path : maintainers.json
53
+ key : maintainers
54
+
49
55
- name : Build website
50
56
run : python web/pandas_web.py web/pandas --target-path=web/build
51
57
Original file line number Diff line number Diff line change 27
27
import collections
28
28
import datetime
29
29
import importlib
30
+ import json
30
31
import operator
31
32
import os
32
33
import pathlib
@@ -163,6 +164,18 @@ def maintainers_add_info(context):
163
164
Given the active maintainers defined in the yaml file, it fetches
164
165
the GitHub user information for them.
165
166
"""
167
+ timestamp = time .time ()
168
+
169
+ cache_file = pathlib .Path ("maintainers.json" )
170
+ if cache_file .is_file ():
171
+ with open (cache_file ) as f :
172
+ context ["maintainers" ] = json .load (f )
173
+ # refresh cache after 1 hour
174
+ if (timestamp - context ["maintainers" ]["timestamp" ]) < 3_600 :
175
+ return context
176
+
177
+ context ["maintainers" ]["timestamp" ] = timestamp
178
+
166
179
repeated = set (context ["maintainers" ]["active" ]) & set (
167
180
context ["maintainers" ]["inactive" ]
168
181
)
@@ -179,6 +192,10 @@ def maintainers_add_info(context):
179
192
return context
180
193
resp .raise_for_status ()
181
194
context ["maintainers" ][f"{ kind } _with_github_info" ].append (resp .json ())
195
+
196
+ with open (cache_file , "w" ) as f :
197
+ json .dump (context ["maintainers" ], f )
198
+
182
199
return context
183
200
184
201
@staticmethod
You can’t perform that action at this time.
0 commit comments