kopia lustrzana https://github.com/kartoza/docker-osm
Fix timezone compare error on osmenrich
rodzic
d2040fc09b
commit
b9f7988970
|
@ -26,6 +26,7 @@ from os.path import join, exists, getsize
|
||||||
from sys import exit, stderr
|
from sys import exit, stderr
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from urllib import request
|
from urllib import request
|
||||||
|
from datetime import timezone
|
||||||
|
|
||||||
import xmltodict
|
import xmltodict
|
||||||
import yaml
|
import yaml
|
||||||
|
@ -319,7 +320,7 @@ class Enrich(object):
|
||||||
if osm_id and row:
|
if osm_id and row:
|
||||||
allow_updated = False
|
allow_updated = False
|
||||||
osm_timestamp = self.check_data_on_dict(from_osm, '@timestamp')
|
osm_timestamp = self.check_data_on_dict(from_osm, '@timestamp')
|
||||||
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=None)
|
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=timezone.utc)
|
||||||
if not row['changeset_timestamp'] or row['changeset_timestamp'] < osm_datetime:
|
if not row['changeset_timestamp'] or row['changeset_timestamp'] < osm_datetime:
|
||||||
allow_updated = True
|
allow_updated = True
|
||||||
if allow_updated:
|
if allow_updated:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
psycopg2-binary==2.9.4
|
psycopg2-binary==2.9.9
|
||||||
python-dateutil==2.8.2
|
python-dateutil==2.8.2
|
||||||
PyYAML==6.0
|
PyYAML==6.0.1
|
||||||
xmltodict==0.13.0
|
xmltodict==0.13.0
|
Ładowanie…
Reference in New Issue