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

Remove unused SynapseService #9058

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9058.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused `SynapseService` class.
22 changes: 0 additions & 22 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import gc
import logging
import os
import sys
from typing import Iterable, Iterator

from twisted.application import service
from twisted.internet import defer, reactor
from twisted.python.failure import Failure
from twisted.web.resource import EncodingResourceWrapper, IResource
Expand Down Expand Up @@ -73,7 +71,6 @@
from synapse.util.httpresourcetree import create_resource_tree
from synapse.util.manhole import manhole
from synapse.util.module_loader import load_module
from synapse.util.rlimit import change_resource_limit
from synapse.util.versionstring import get_version_string

logger = logging.getLogger("synapse.app.homeserver")
Expand Down Expand Up @@ -487,25 +484,6 @@ def format_config_error(e: ConfigError) -> Iterator[str]:
e = e.__cause__


class SynapseService(service.Service):
"""
A twisted Service class that will start synapse. Used to run synapse
via twistd and a .tac.
"""

def __init__(self, config):
self.config = config

def startService(self):
hs = setup(self.config)
change_resource_limit(hs.config.soft_file_limit)
if hs.config.gc_thresholds:
gc.set_threshold(*hs.config.gc_thresholds)

def stopService(self):
return self._port.stopListening()


def run(hs):
PROFILE_SYNAPSE = False
if PROFILE_SYNAPSE:
Expand Down