mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:06:06 -04:00
Add missing type hints to synapse.http. (#11571)
This commit is contained in:
parent
ff6fd52160
commit
33abbc3278
8 changed files with 76 additions and 51 deletions
|
@ -13,7 +13,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from canonicaljson import encode_canonical_json
|
||||
from signedjson.sign import sign_json
|
||||
|
@ -99,7 +99,7 @@ class LocalKey(Resource):
|
|||
json_object = sign_json(json_object, self.config.server.server_name, key)
|
||||
return json_object
|
||||
|
||||
def render_GET(self, request: Request) -> int:
|
||||
def render_GET(self, request: Request) -> Optional[int]:
|
||||
time_now = self.clock.time_msec()
|
||||
# Update the expiry time if less than half the interval remains.
|
||||
if time_now + self.config.key.key_refresh_interval / 2 > self.valid_until_ts:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue