comparison twisted/plugins/libervia_server.py @ 1125:56ace2d45783

server (twisted): install reactor before doing anything else
author Goffi <goffi@goffi.org>
date Fri, 31 Aug 2018 18:05:15 +0200
parents 28e3eb3bb217
children 6414fd795df4
comparison
equal deleted inserted replaced
1124:28e3eb3bb217 1125:56ace2d45783
17 # GNU Affero General Public License for more details. 17 # GNU Affero General Public License for more details.
18 18
19 # You should have received a copy of the GNU Affero General Public License 19 # You should have received a copy of the GNU Affero General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>. 20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21
22 from twisted.internet import gireactor
23 gireactor.install()
22 from twisted.internet import defer 24 from twisted.internet import defer
23 25
24 if defer.Deferred.debug: 26 if defer.Deferred.debug:
25 # if we are in debug mode, we want to use ipdb instead of pdb 27 # if we are in debug mode, we want to use ipdb instead of pdb
26 try: 28 try:
164 ] 166 ]
165 167
166 168
167 def initialise(options): 169 def initialise(options):
168 """Method to initialise global modules""" 170 """Method to initialise global modules"""
169 from twisted.internet import gireactor
170 gireactor.install()
171
172 # XXX: We need to configure logs before any log method is used, 171 # XXX: We need to configure logs before any log method is used,
173 # so here is the best place. 172 # so here is the best place.
174 from sat.core import log_config 173 from sat.core import log_config
175 174
176 log_config.satConfigure(C.LOG_BACKEND_TWISTED, C, backend_data=options) 175 log_config.satConfigure(C.LOG_BACKEND_TWISTED, C, backend_data=options)