예제 #1
0
    def makeService(self, options):
        """Construct a TCPServer from a factory defined in hello_world
        """

        factory, application = MambaApplicationFactory(settings)
        factory.sessionFactory = Session

        httpserver = internet.TCPServer(int(options['port']), factory)
        httpserver.setName('{} Application'.format(settings.name))
        application.addService(httpserver)

        thread_pool = ThreadPoolService(database.Database.pool)
        application.addService(thread_pool)

        if are_we_on_heroku():
            application.addService(HerokuService())

        return application
예제 #2
0
    def makeService(self, options):
        """Construct a TCPServer from a factory defined in eblana_app
        """

        factory, application = MambaApplicationFactory(settings)
        factory.sessionFactory = Session

        httpserver = internet.TCPServer(int(options['port']), factory)
        httpserver.setName('{} Application'.format(settings.name))
        application.addService(httpserver)

        thread_pool = ThreadPoolService(database.Database.pool)
        application.addService(thread_pool)

        if are_we_on_heroku():
            application.addService(HerokuService())

        return application
예제 #3
0
 def __init__(self):
     self.name = 'HerokuService'
     self.on_heroku = heroku.are_we_on_heroku()
     self.allowed = config.Application().force_heroku_awake
     self.ping_task = task.LoopingCall(self.ping)
예제 #4
0
    def test_are_we_on_heroku(self):

        self.assertFalse(heroku.are_we_on_heroku())
        os.environ['PYTHONHOME'] = '/app/.heroku/python'
        self.assertTrue(heroku.are_we_on_heroku())
        del os.environ['PYTHONHOME']
예제 #5
0
    def test_are_we_on_heroku(self):

        self.assertFalse(heroku.are_we_on_heroku())
        os.environ['PYTHONHOME'] = '/app/.heroku/python'
        self.assertTrue(heroku.are_we_on_heroku())
        del os.environ['PYTHONHOME']
예제 #6
0
 def __init__(self):
     self.name = 'HerokuService'
     self.on_heroku = heroku.are_we_on_heroku()
     self.allowed = config.Application().force_heroku_awake
     self.ping_task = task.LoopingCall(self.ping)