mirror of
https://github.com/element-hq/synapse.git
synced 2026-07-20 04:51:09 +00:00
Add method to get current server time in milliseconds in ModuleApi (#18144)
- Add `get_current_time_msec()` method to the [module API](https://matrix-org.github.io/synapse/latest/modules/writing_a_module.html) for sound time comparisons with Synapse. - Fixes #18104 Signed-off-by: Ahmed Qashlan <ahmedelqashlan@gmail.com> Co-authored-by: Eric Eastwood <madlittlemods@gmail.com> Co-authored-by: Erik Johnston <erikj@jki.re>
This commit is contained in:
co-authored by
Eric Eastwood
Erik Johnston
parent
12dc6b102f
commit
2d4f28915e
@@ -0,0 +1 @@
|
||||
Add `get_current_time_msec()` method to the [module API](https://matrix-org.github.io/synapse/latest/modules/writing_a_module.html) for sound time comparisons with Synapse.
|
||||
@@ -1846,6 +1846,10 @@ class ModuleApi:
|
||||
deactivation=deactivation,
|
||||
)
|
||||
|
||||
def get_current_time_msec(self) -> int:
|
||||
"""Returns the current server time in milliseconds."""
|
||||
return self._clock.time_msec()
|
||||
|
||||
|
||||
class PublicRoomListManager:
|
||||
"""Contains methods for adding to, removing from and querying whether a room
|
||||
|
||||
Reference in New Issue
Block a user