コード例 #1
0
ファイル: action.py プロジェクト: esho/platoon
    def _purge_database(self, session):
        from platoon.models import Event, ScheduledTask, SubscribedTask
        platoon = get_unit('platoon.component.Platoon')

        Event.purge(session, platoon.configuration['completed_event_lifetime'])
        ScheduledTask.purge(session, platoon.configuration['completed_task_lifetime'])
        SubscribedTask.purge(session, platoon.configuration['completed_task_lifetime'])

        session.commit()
コード例 #2
0
    def _purge_database(self, session):
        from platoon.models import Event, ScheduledTask, SubscribedTask
        platoon = get_unit('platoon.component.Platoon')

        Event.purge(session, platoon.configuration['completed_event_lifetime'])
        ScheduledTask.purge(session,
                            platoon.configuration['completed_task_lifetime'])
        SubscribedTask.purge(session,
                             platoon.configuration['completed_task_lifetime'])

        session.commit()
コード例 #3
0
ファイル: queue.py プロジェクト: siq-legacy/platoon
    def run(self):
        from platoon.models import Event, Process, ScheduledTask

        idler = self.idler
        schema = self.schema
        session = schema.session
        threads = self.threads

        ScheduledTask.retry_executing_tasks(session)

        while True:
            idler.idle()
            try:
                Event.process_events(session)
                Process.process_processes(self, session)
                ScheduledTask.process_tasks(self, session)
            finally:
                session.close()