Mercurial > personal > weatherlog
diff weatherlog/types.py @ 14:c01f9929ae38
Make logger and HTTP writer more general and resilient.
This makes the logger and HTTP writer more general, by removing
any dependency upon the exact data type they are writing.
They can now handle any type of BSON-serializable dict,
and track what they have sent by keeping track of the last *byte*,
not the last timestamp.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Tue, 15 Oct 2019 22:40:24 -0400 |
parents | 885bff085edf |
children | b5625b531d2d |
line wrap: on
line diff
--- a/weatherlog/types.py Sun Sep 29 12:11:16 2019 -0400 +++ b/weatherlog/types.py Tue Oct 15 22:40:24 2019 -0400 @@ -9,7 +9,7 @@ def _utc_now() -> datetime.datetime: """utcnow, but timezone-aware.""" - return datetime.datetime.utcnow().replace(tzinfo=pytz.UTC) + return datetime.datetime.now(tz=pytz.UTC) @attr.s(frozen=True, slots=True)