|
15 | 15 | # See the License for the specific language governing permissions and
|
16 | 16 | # limitations under the License.
|
17 | 17 |
|
18 |
| -import gc |
19 | 18 | import logging
|
20 | 19 | import os
|
21 | 20 | import sys
|
22 | 21 | from typing import Iterable, Iterator
|
23 | 22 |
|
24 |
| -from twisted.application import service |
25 | 23 | from twisted.internet import defer, reactor
|
26 | 24 | from twisted.python.failure import Failure
|
27 | 25 | from twisted.web.resource import EncodingResourceWrapper, IResource
|
|
73 | 71 | from synapse.util.httpresourcetree import create_resource_tree
|
74 | 72 | from synapse.util.manhole import manhole
|
75 | 73 | from synapse.util.module_loader import load_module
|
76 |
| -from synapse.util.rlimit import change_resource_limit |
77 | 74 | from synapse.util.versionstring import get_version_string
|
78 | 75 |
|
79 | 76 | logger = logging.getLogger("synapse.app.homeserver")
|
@@ -487,25 +484,6 @@ def format_config_error(e: ConfigError) -> Iterator[str]:
|
487 | 484 | e = e.__cause__
|
488 | 485 |
|
489 | 486 |
|
490 |
| -class SynapseService(service.Service): |
491 |
| - """ |
492 |
| - A twisted Service class that will start synapse. Used to run synapse |
493 |
| - via twistd and a .tac. |
494 |
| - """ |
495 |
| - |
496 |
| - def __init__(self, config): |
497 |
| - self.config = config |
498 |
| - |
499 |
| - def startService(self): |
500 |
| - hs = setup(self.config) |
501 |
| - change_resource_limit(hs.config.soft_file_limit) |
502 |
| - if hs.config.gc_thresholds: |
503 |
| - gc.set_threshold(*hs.config.gc_thresholds) |
504 |
| - |
505 |
| - def stopService(self): |
506 |
| - return self._port.stopListening() |
507 |
| - |
508 |
| - |
509 | 487 | def run(hs):
|
510 | 488 | PROFILE_SYNAPSE = False
|
511 | 489 | if PROFILE_SYNAPSE:
|
|
0 commit comments