From f164bea4af825d817176883a7cd7fb010a4fc3c9 Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Wed, 23 Dec 2015 10:49:52 +0100 Subject: [PATCH] fix #22 write database timestamp to a file --- docker-imposm3/importer.py | 8 ++++++++ settings/timestamp.txt | 1 + 2 files changed, 9 insertions(+) create mode 100644 settings/timestamp.txt diff --git a/docker-imposm3/importer.py b/docker-imposm3/importer.py index a7d1436..8938bf0 100644 --- a/docker-imposm3/importer.py +++ b/docker-imposm3/importer.py @@ -214,6 +214,14 @@ while True: move( join(default['IMPORT_QUEUE'], diff), join(default['IMPORT_DONE'], diff)) + + # Update the timestamp in the file. + database_timestamp = diff.split('.')[0].split('->-')[1] + file_path = join(default['SETTINGS'], 'timestamp.txt') + timestamp_file = open(file_path, 'w') + timestamp_file.write(database_timestamp) + timestamp_file.close() + print 'Import diff successful : %s' % diff else: print >> stderr, 'An error occured in imposm with a diff.' diff --git a/settings/timestamp.txt b/settings/timestamp.txt new file mode 100644 index 0000000..4ad3dc3 --- /dev/null +++ b/settings/timestamp.txt @@ -0,0 +1 @@ +UNDEFINED