Skip to content

Commit c6f3d47

Browse files
authored
Merge pull request #167 from mzmcbride/yay-for-onwiki-reports
Nothing should come before checking {{database report}}
2 parents 5ae2805 + 9576ed1 commit c6f3d47

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

dbreps2/src/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,6 @@ pub trait Report<T: Send + Sync> {
185185
}
186186

187187
fn needs_update(&self, old_text: &str) -> Result<bool> {
188-
if let Some(hour) = self.frequency().at_hour() {
189-
// If we are supposed to run at a specific time
190-
// and it is that time, then run!
191-
if OffsetDateTime::now_utc().hour() == hour {
192-
return Ok(true);
193-
}
194-
}
195-
196188
// Pages with {{database report}} are maintained by SDZeroBot and contain the SQL queries
197189
// directly. Skip updating the report if it has been migrated to use that template.
198190
if contains_database_report_template(old_text) {
@@ -202,6 +194,15 @@ pub trait Report<T: Send + Sync> {
202194
);
203195
return Ok(false);
204196
}
197+
198+
if let Some(hour) = self.frequency().at_hour() {
199+
// If we are supposed to run at a specific time
200+
// and it is that time, then run!
201+
if OffsetDateTime::now_utc().hour() == hour {
202+
return Ok(true);
203+
}
204+
}
205+
205206
let re = Regex::new("<onlyinclude>(.*?)</onlyinclude>").unwrap();
206207
let ts = match re.captures(old_text) {
207208
Some(cap) => cap[1].to_string(),

0 commit comments

Comments
 (0)