dispatcher: consistent handling of missing timestamps

Like in `read` replies (line 193), `update` now omits the timestamp
instead of returning {"t": 0}.

Change-Id: Iaee0fccae81040cdd6075b0e4a8600c032aec03d
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/33382
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Georg Brandl
2024-03-26 08:51:35 +01:00
committed by Alexander Zaft
parent 9aba3db8a6
commit c496a42830

View File

@@ -47,9 +47,11 @@ def make_update(modulename, pobj):
if pobj.readerror:
return (ERRORPREFIX + EVENTREPLY, f'{modulename}:{pobj.export}',
# error-report !
[pobj.readerror.name, str(pobj.readerror), {'t': pobj.timestamp}])
[pobj.readerror.name, str(pobj.readerror),
{'t': pobj.timestamp} if pobj.timestamp else {}])
return (EVENTREPLY, f'{modulename}:{pobj.export}',
[pobj.export_value(), {'t': pobj.timestamp}])
[pobj.export_value(),
{'t': pobj.timestamp} if pobj.timestamp else {}])
class Dispatcher: