--- title: LinkChecker Flow --- # LinkChecker Flow Every night, starting at 01:00 clock time, configured by the properties in the `[linkchecker]` section of `ezid.conf`, a daemon thread in EZID issues these initial queries: ```sql SELECT id, identifier, linkIsBroken FROM ezidapp_searchidentifier WHERE identifier > '' ORDER BY identifier ASC LIMIT 1000 ``` ```sql SELECT id, identifier, numFailures FROM ezidapp_linkchecker WHERE identifier > '' ORDER BY identifier ASC LIMIT 1000 ``` The latter query has the additional filter applied in python to the results: ``` numFailures >= notificationThreshold ``` The queries are repeated using the identifier value from the last result as the WHERE clause variable in subsequent batches of 1000. The queries are looped, traversing the entire set of entries in the `searchIdentifiers` and `linkchecker` tables. For each record in `searchIdentifier`, if there's a corresponding link checker entry (with `numFailures` past the threshold), then the `searchIdentifier.linkIsBroken` is set to True (1) or if there's no corresponding `linkChecker` entry, `linkIsBroken` is set to False (0) (which also clears a broken link status). During the save to `searchIdentifier`, the `hasIssues` field is set `True` if the record has Metadata and `linkIsBroken` or `isCrossrefBad` is True. The `linkChecker` table is updated by... the `link-checker` script, which "runs continuously and indefinitely".