mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
get geolocation at first poll (#9522)
* get geolocation at first poll based on the logic of code, we will have to wait 2 days from adding new device for lat and lng to be updated * Update Location.php * Update Location.php
This commit is contained in:
@ -84,7 +84,7 @@ class Location extends Model
|
|||||||
|
|
||||||
if (!$this->hasCoordinates() &&
|
if (!$this->hasCoordinates() &&
|
||||||
\LibreNMS\Config::get('geoloc.latlng', true) &&
|
\LibreNMS\Config::get('geoloc.latlng', true) &&
|
||||||
$this->timestamp && $this->timestamp->diffInDays() > 2
|
(!$this->id || $this->timestamp && $this->timestamp->diffInDays() > 2)
|
||||||
) {
|
) {
|
||||||
$this->fetchCoordinates();
|
$this->fetchCoordinates();
|
||||||
$this->updateTimestamps();
|
$this->updateTimestamps();
|
||||||
|
Reference in New Issue
Block a user