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:
pcw11211
2018-12-07 00:09:20 -05:00
committed by Tony Murray
parent f5dbbf7772
commit 3becce44e7

View File

@ -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();