diff -r ff125aa259db -r 8b4e205ffc94 delinquent_files/demon.php --- a/delinquent_files/demon.php Sat Feb 17 15:34:18 2024 +0100 +++ b/delinquent_files/demon.php Sat Feb 17 15:36:09 2024 +0100 @@ -1,6 +1,10 @@ #!/usr/bin/php +#$Id$ +# + d->debug( "Getting api of " . $wiki) ; + // temp workaround 3/22/2023 + //if ($wiki === 'bclwiktionary' || $wiki === 'bjnwiktionary' || $wiki === 'gorwiktionary') { + // return false; + //} $api = $this->getAPI ( $wiki ) ; if ( $api ) { $services = new \Mediawiki\Api\MediawikiFactory( $api ); $page = $services->newPageGetter()->getFromTitle( $pagename ); $revision = $page->getRevisions()->getLatest(); - + if ( $revision ) { $ret = $revision->getContent()->getData() ; } @@ -475,14 +485,17 @@ } function clearBogusIssues ( $db ) { + + $ts = date ( 'YmdHis' , time() - 60*60*24*7 ); # look back 7 days only + # Clear some previous issues // 0=pending // 1=done // 2=skipped - $sql = "update `event` set done=0,note='' where note like '%rate limit%' and done=2" ; + $sql = "update `event` set done=0,note='' where note like '%rate limit%' and done=2 and timestamp>'$ts'" ; $this->d->debug("Set done=0 (pending) on 'rate limit' events where done=2(skipped)"); $this->runQuery ( $db , $sql ) ; - $sql = "update `event` set done=0,note='' where note like '%edit conflict%' and done=2" ; + $sql = "update `event` set done=0,note='' where note like '%edit conflict%' and done=2 and timestamp>'$ts'" ; $this->d->debug("Set done=0 (pending) on 'edit conflict' events where done=2(skipped)"); $this->runQuery ( $db , $sql ) ; } @@ -509,7 +522,7 @@ try { $this->performEdit ( $o ) ; } catch (Exception $e) { - echo 'Caught exception: ', $e->getMessage(), "\n"; + echo 'Caught exception: ', $e->getMessage(), "\n"; } $last_wiki = $o->wiki ; }