mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
discovery.php: don't exit(5) without new devices discovered (#8893)
Don't exit with a non-zero value in case no new devices were discovered, as non-zero codes are considered failed jobs for most cron implementations and produce logs like the following (in Debian): ``` cron.info CRON[963890]: (CRON) error (grandchild #963892 failed with exit status 5) ``` DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [X] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
This commit is contained in:
@@ -153,7 +153,7 @@ if (!isset($options['q'])) {
|
||||
|
||||
logfile($string);
|
||||
|
||||
if ($discovered_devices == 0) {
|
||||
if ($doing !== 'new' && $discovered_devices == 0) {
|
||||
# No discoverable devices, either down or disabled
|
||||
exit(5);
|
||||
}
|
||||
|
Reference in New Issue
Block a user