File tree 2 files changed +31
-2
lines changed
2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change
1
+ Config syntax
2
+ ~~~~~~~~~~~~~
3
+
4
+ This document describes the fields of the config file and their meaning.
5
+
6
+ poller
7
+ ======
8
+
9
+ Section configuring patch ingest.
10
+
11
+ recheck_period
12
+ --------------
13
+
14
+ During normal operation poller fetches only the new patches - patches which
15
+ were sent since the previous check (minus 10 minutes to account for email lag).
16
+
17
+ To catch patches which got stuck in the email systems for longer, or got sent with
18
+ a date in the past poller will periodically scan patchwork looking back further into
19
+ the past.
20
+
21
+ ``recheck_period `` defines the period of the long scans in hours.
22
+
23
+ recheck_lookback
24
+ ----------------
25
+
26
+ Defines the length of the long history scan, see ``recheck_period ``.
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ def __init__(self) -> None:
78
78
self .seen_series = set (self ._state ['done_series' ])
79
79
self .done_series = self .seen_series .copy ()
80
80
81
+ self ._recheck_period = config .getint ('poller' , 'recheck_period' , fallback = 3 )
82
+ self ._recheck_lookback = config .getint ('poller' , 'recheck_lookback' , fallback = 9 )
83
+
81
84
def init_state_from_disk (self ) -> None :
82
85
try :
83
86
with open ('poller.state' , 'r' ) as f :
@@ -200,9 +203,9 @@ def run(self) -> None:
200
203
req_time = datetime .datetime .utcnow ()
201
204
202
205
# Decide if this is a normal 4 minute history poll or big scan of last 12 hours
203
- if prev_big_scan + datetime .timedelta (hours = 3 ) < req_time :
206
+ if prev_big_scan + datetime .timedelta (hours = self . _recheck_period ) < req_time :
204
207
big_scan = True
205
- since = prev_big_scan - datetime .timedelta (hours = 9 )
208
+ since = prev_big_scan - datetime .timedelta (hours = self . _recheck_lookback )
206
209
log_open_sec (f"Big scan of last 12 hours at { req_time } since { since } " )
207
210
else :
208
211
big_scan = False
You can’t perform that action at this time.
0 commit comments