|
|
@@ -182,4 +182,11 @@
|
|
|
(get-element "timestampMs" less)))))))
|
|
|
|
|
|
(defun on-cron ()
|
|
|
- (import-location-events (local-time:timestamp- (today) 1 :day)))
|
|
|
+ (let* ((last-loc (first (docs (db.sort "locations" :all :field "timestampMs"
|
|
|
+ :asc nil :limit 1))))
|
|
|
+ (from (or (and last-loc (doc->ts last-loc))
|
|
|
+ (local-time:timestamp- (today) 3 :day)))
|
|
|
+ (to (local-time:timestamp-minimum
|
|
|
+ (local-time:timestamp+ from 3 :day)
|
|
|
+ (local-time:now))))
|
|
|
+ (import-location-events from to)))
|