merged master
diff --git a/xos/core/models/plcorebase.py b/xos/core/models/plcorebase.py
index 00061b6..76c2e54 100644
--- a/xos/core/models/plcorebase.py
+++ b/xos/core/models/plcorebase.py
@@ -2,6 +2,7 @@
import json
import os
import sys
+import threading
from django import db
from django.db import models
from django.forms.models import model_to_dict
@@ -270,6 +271,9 @@
if not (field in ["backend_register", "backend_status", "deleted", "enacted", "updated"]):
ignore_composite_key_check=False
+ if 'synchronizer' not in threading.current_thread().name:
+ self.updated = datetime.datetime.now()
+
super(PlCoreBase, self).save(*args, **kwargs)
# This is a no-op if observer_disabled is set
diff --git a/xos/synchronizers/base/backend.py b/xos/synchronizers/base/backend.py
index c4f0f0f..6093992 100644
--- a/xos/synchronizers/base/backend.py
+++ b/xos/synchronizers/base/backend.py
@@ -15,7 +15,7 @@
def run(self):
# start the openstack observer
observer = XOSObserver()
- observer_thread = threading.Thread(target=observer.run)
+ observer_thread = threading.Thread(target=observer.run,name='synchronizer')
observer_thread.start()
# start model policies thread
diff --git a/xos/synchronizers/base/event_loop.py b/xos/synchronizers/base/event_loop.py
index f224380..4f7d436 100644
--- a/xos/synchronizers/base/event_loop.py
+++ b/xos/synchronizers/base/event_loop.py
@@ -521,7 +521,12 @@
loop_end = time.time()
- diag = Diag.objects.filter(name=Config().observer_name).first()
+ try:
+ observer_name = Config().observer_name
+ except:
+ observer_name = ''
+
+ diag = Diag.objects.filter(name=observer_name).first()
if (diag):
br_str = diag.backend_register
br = json.loads(br_str)