Code review comment for ~dashmage/charm-sysconfig:bug-2012581/clear-notification-fix

Revision history for this message
Ashley James (dashmage) wrote :

> Why we need to flush local's unit data here? Also the previous line is `set`, flush after set look make not sense to me.
> Could you explain why we need to do this?

So without explicitly adding `unitdata.kv().flush()` it seems that the local unit's data is not being written to the DB. Without this line, when we try to get the value later, it's only returning `None`.

For the other line, `datetime.fromtimestamp` is the correct function to convert the POSIX timestamp (in float) to the local date.

« Back to merge proposal