frappy_psi/sea: yet another fix: BUSY after write target
it seems update_is_running runs in parallel to write_target and read_status can not run before write_target has finished due to locks -> call read_status within write_target
This commit is contained in:
parent
bfbb8172e0
commit
7536454e96
@ -724,16 +724,23 @@ class SeaDrivable(SeaReadable, Drivable):
|
|||||||
self._is_running = None
|
self._is_running = None
|
||||||
self._bad_start = 0
|
self._bad_start = 0
|
||||||
self.io.query(f'run {self.sea_object} {value}')
|
self.io.query(f'run {self.sea_object} {value}')
|
||||||
if not self._is_running:
|
if self._is_running:
|
||||||
self.log.warn('is_running is not set after run')
|
self.read_status()
|
||||||
|
if not self.isDriving():
|
||||||
|
self.log.warn('status is not set after run')
|
||||||
self._bad_start = time.time()
|
self._bad_start = time.time()
|
||||||
self.status = BUSY, 'changed target'
|
self.status = BUSY, 'changed target'
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def update_is_running(self, value, timestamp, readerror):
|
def update_is_running(self, value, timestamp, readerror):
|
||||||
if not readerror:
|
if readerror:
|
||||||
|
self.log.warn('error in update_is_running %r', readerror)
|
||||||
|
else:
|
||||||
self._is_running = value
|
self._is_running = value
|
||||||
self.read_status()
|
try:
|
||||||
|
self.read_status()
|
||||||
|
except Exception as e:
|
||||||
|
self.log.info('read_status failed %r', e)
|
||||||
|
|
||||||
def read_status(self):
|
def read_status(self):
|
||||||
status = super().read_status()
|
status = super().read_status()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user