[icinga-checkins] icinga.org: icingaweb2-module-director/master: ImportSource: set last_attempt on every attempt

git at icinga.org git at icinga.org
Mon Jun 27 09:17:10 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: 38fec2c3d596a89c20c1902a6c3e5b26dbb8db39
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=38fec2c3d596a89c20c1902a6c3e5b26dbb8db39

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sun Jun 26 16:00:43 2016 +0200

ImportSource: set last_attempt on every attempt

---

 library/Director/Objects/ImportSource.php |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/library/Director/Objects/ImportSource.php b/library/Director/Objects/ImportSource.php
index 41d03ff..65152ba 100644
--- a/library/Director/Objects/ImportSource.php
+++ b/library/Director/Objects/ImportSource.php
@@ -81,6 +81,7 @@ class ImportSource extends DbObjectWithSettings
         Benchmark::measure('Starting with import ' . $this->source_name);
         try {
             $import = new Import($this);
+            $this->last_attempt = date('Y-m-d H:i:s');
             if ($import->providesChanges()) {
                 Benchmark::measure('Found changes for ' . $this->source_name);
                 $this->hadChanges = true;
@@ -99,7 +100,7 @@ class ImportSource extends DbObjectWithSettings
         } catch (Exception $e) {
             $this->import_state = 'failing';
             Benchmark::measure('Import failed for ' . $this->source_name);
-            $this->last_error_message = 'ERR: ' . $e->getMessage();
+            $this->last_error_message = $e->getMessage();
         }
 
         if ($this->hasBeenModified()) {



More information about the icinga-checkins mailing list