mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-14 09:45:51 +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:
parent
12dc6b102f
commit
2d4f28915e
2 changed files with 5 additions and 0 deletions
1
changelog.d/18144.feature
Normal file
1
changelog.d/18144.feature
Normal file
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue