From d7259230681731cbf65e5bd046769cce215fdf9e Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 15 Apr 2021 16:36:36 +0100 Subject: Add a util file for non API-specific constants, and move ONE_HOUR to it (This constant is used in the next commit.) So there's not much here right now, and perhaps this could fit better in another file. Though I didn't see anything quite appropriate. --- synapse/appservice/api.py | 3 +-- synapse/util/constants.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 synapse/util/constants.py diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py index fe04d7a672..57a073ac77 100644 --- a/synapse/appservice/api.py +++ b/synapse/appservice/api.py @@ -24,6 +24,7 @@ from synapse.events.utils import serialize_event from synapse.http.client import SimpleHttpClient from synapse.types import JsonDict, ThirdPartyInstanceID from synapse.util.caches.response_cache import ResponseCache +from synapse.util.constants import HOUR_IN_MS if TYPE_CHECKING: from synapse.appservice import ApplicationService @@ -46,8 +47,6 @@ sent_events_counter = Counter( "synapse_appservice_api_sent_events", "Number of events sent to the AS", ["service"] ) -HOUR_IN_MS = 60 * 60 * 1000 - APP_SERVICE_PREFIX = "/_matrix/app/unstable" diff --git a/synapse/util/constants.py b/synapse/util/constants.py new file mode 100644 index 0000000000..ece1941b06 --- /dev/null +++ b/synapse/util/constants.py @@ -0,0 +1,15 @@ +# Copyright 2021 The Matrix.org Foundation C.I.C. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +HOUR_IN_MS = 60 * 60 * 1000 -- cgit 1.4.1