Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
lint and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dklimpel committed Nov 11, 2021
1 parent 1e5c5a4 commit 949e55f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions synapse/handlers/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class PaginationHandler:
"""

# when to remove a completed deletion/purge from the results map
CLEAR_PURGE_AFTER_MS = 1000 * 3600 * 24 # 24 hours
CLEAR_PURGE_AFTER_MS = 1000 * 3600 * 24 # 24 hours

def __init__(self, hs: "HomeServer"):
self.hs = hs
Expand Down Expand Up @@ -370,7 +370,7 @@ def clear_purge() -> None:
del self._purges_by_id[purge_id]

self.hs.get_reactor().callLater(
PaginationHandler.CLEAR_PURGE_AFTER_MS/1000, clear_purge
PaginationHandler.CLEAR_PURGE_AFTER_MS / 1000, clear_purge
)

def get_purge_status(self, purge_id: str) -> Optional[PurgeStatus]:
Expand Down Expand Up @@ -660,7 +660,7 @@ def clear_delete() -> None:
del self._delete_by_room[room_id]

self.hs.get_reactor().callLater(
PaginationHandler.CLEAR_PURGE_AFTER_MS/1000, clear_delete
PaginationHandler.CLEAR_PURGE_AFTER_MS / 1000, clear_delete
)

def start_shutdown_and_purge_room(
Expand Down
6 changes: 3 additions & 3 deletions tests/rest/admin/test_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ def test_delete_expired_status(self):
delete_id1 = channel.json_body["delete_id"]

# go ahead
self.reactor.advance(PaginationHandler.CLEAR_PURGE_TIME / 2)
self.reactor.advance(PaginationHandler.CLEAR_PURGE_AFTER_MS / 1000 / 2)

# second task
channel = self.make_request(
Expand Down Expand Up @@ -673,7 +673,7 @@ def test_delete_expired_status(self):

# get status after more than clearing time for first task
# second task is not cleared
self.reactor.advance(PaginationHandler.CLEAR_PURGE_TIME / 2)
self.reactor.advance(PaginationHandler.CLEAR_PURGE_AFTER_MS / 1000 / 2)

channel = self.make_request(
"GET",
Expand All @@ -687,7 +687,7 @@ def test_delete_expired_status(self):
self.assertEqual(delete_id2, channel.json_body["results"][0]["delete_id"])

# get status after more than clearing time for all tasks
self.reactor.advance(PaginationHandler.CLEAR_PURGE_TIME / 2)
self.reactor.advance(PaginationHandler.CLEAR_PURGE_AFTER_MS / 1000 / 2)

channel = self.make_request(
"GET",
Expand Down

0 comments on commit 949e55f

Please sign in to comment.