29
29
import os
30
30
import subprocess
31
31
import sys
32
+ from typing import Any , Dict , Set
32
33
33
34
import jinja2
34
35
import yaml
35
36
36
37
MAIN_PROCESS_HTTP_LISTENER_PORT = 8080
37
38
38
39
39
- WORKERS_CONFIG = {
40
+ WORKERS_CONFIG : Dict [ str , Dict [ str , Any ]] = {
40
41
"pusher" : {
41
42
"app" : "synapse.app.pusher" ,
42
43
"listener_resources" : [],
@@ -355,7 +356,7 @@ def generate_worker_files(environ, config_path: str, data_dir: str):
355
356
# worker_type: {1234, 1235, ...}}
356
357
# }
357
358
# and will be used to construct 'upstream' nginx directives.
358
- nginx_upstreams = {}
359
+ nginx_upstreams : Dict [ str , Set [ int ]] = {}
359
360
360
361
# A map of: {"endpoint": "upstream"}, where "upstream" is a str representing what will be
361
362
# placed after the proxy_pass directive. The main benefit to representing this data as a
@@ -384,7 +385,7 @@ def generate_worker_files(environ, config_path: str, data_dir: str):
384
385
# A counter of worker_type -> int. Used for determining the name for a given
385
386
# worker type when generating its config file, as each worker's name is just
386
387
# worker_type + instance #
387
- worker_type_counter = {}
388
+ worker_type_counter : Dict [ str , int ] = {}
388
389
389
390
# For each worker type specified by the user, create config values
390
391
for worker_type in worker_types :
@@ -404,7 +405,7 @@ def generate_worker_files(environ, config_path: str, data_dir: str):
404
405
# e.g. federation_reader1
405
406
worker_name = worker_type + str (new_worker_count )
406
407
worker_config .update (
407
- {"name" : worker_name , "port" : worker_port , "config_path" : config_path }
408
+ {"name" : worker_name , "port" : str ( worker_port ) , "config_path" : config_path }
408
409
)
409
410
410
411
# Update the shared config with any worker-type specific options
0 commit comments