Die Verzögerungen hatte ich auch gestern bemerkt - schätze mal lib/connection wartetete auf Timeouts?
//edit: Fix für unten stehendes Problem:
Code:
diff --git a/lib/logic.py b/lib/logic.py
index faafd05..23ee2ac 100755
--- a/lib/logic.py
+++ b/lib/logic.py
@@ -97,7 +97,7 @@ class Logic():
self.prio = int(self.prio)
if self.crontab is not None:
if isinstance(self.crontab, list):
- self.crontab = ','.join(self.crontab) # rejoin crontab entry to a string
+ self.crontab = '|'.join(self.crontab) # rejoin crontab entry to a string
def id(self):
return self.name
Habe leider Probleme mit crontab-Einträgen nach der Konvertierung:
crontab = 45 5 * 0,1,2,3,4 | 0 7 * 5,6
Code:
2013-10-09 07:27:05 ERROR Main Unhandled exception: too many values to unpack (expected 4)
<class 'ValueError'>
File "/usr/local/smarthome/bin/smarthome.py", line 646, in <module>
sh.start()
File "/usr/local/smarthome/bin/smarthome.py", line 334, in start
self._logics = lib.logic.Logics(self, configfile=self._logic_conf)
File "/usr/local/smarthome/lib/logic.py", line 50, in __init__
self._sh.scheduler.add(name, logic, logic.prio, logic.crontab, logic.cycle)
File "/usr/local/smarthome/lib/scheduler.py", line 211, in add
self._next_time(name, offset)
File "/usr/local/smarthome/lib/scheduler.py", line 265, in _next_time
ct = self._crontab(entry)
File "/usr/local/smarthome/lib/scheduler.py", line 340, in _crontab
next_event = self._parse_month(crontab, offset=0) # this month
File "/usr/local/smarthome/lib/scheduler.py", line 347, in _parse_month
minute, hour, day, wday = crontab.split(' ')
crontab = init | 00 21 * *
Code:
2013-10-09 07:31:02 ERROR Main Unhandled exception: invalid literal for int() with base 10: 'init'
<class 'ValueError'>
File "/usr/local/smarthome/bin/smarthome.py", line 646, in <module>
sh.start()
File "/usr/local/smarthome/bin/smarthome.py", line 334, in start
self._logics = lib.logic.Logics(self, configfile=self._logic_conf)
File "/usr/local/smarthome/lib/logic.py", line 50, in __init__
self._sh.scheduler.add(name, logic, logic.prio, logic.crontab, logic.cycle)
File "/usr/local/smarthome/lib/scheduler.py", line 211, in add
self._next_time(name, offset)
File "/usr/local/smarthome/lib/scheduler.py", line 265, in _next_time
ct = self._crontab(entry)
File "/usr/local/smarthome/lib/scheduler.py", line 340, in _crontab
next_event = self._parse_month(crontab, offset=0) # this month
File "/usr/local/smarthome/lib/scheduler.py", line 349, in _parse_month
minute_range = self._range(minute, 00, 59)
File "/usr/local/smarthome/lib/scheduler.py", line 459, in _range
item = int(item)


Ich sehe da auch Probleme wenn Plugins mehrmals laufen und verschiedene Instanzen/Logiken gleichzeitig laufen. Das gibt garantiert hier und Ärger.
Einen Kommentar schreiben: