Exemplo n.º 1
0
# limitations under the License.
"""Main loop of the controller process."""

import atexit
import os
import sys
import threading

from decapod_common import config
from decapod_common import log
from decapod_common.models import execution
from decapod_common.models import server
from decapod_common.models import task
from decapod_controller import taskpool

CONF = config.make_controller_config()
"""Config."""

LOG = log.getLogger(__name__)
"""Logger."""

SHUTDOWN_EVENT = threading.Event()
"""Event which should be set by signal handler."""

TASK_POOL = taskpool.TaskPool(CONF["controller"]["worker_threads"])


def main():
    """Daemon main loop."""

    atexit.register(TASK_POOL.stop)
Exemplo n.º 2
0

import atexit
import os
import sys
import threading

from decapod_common import config
from decapod_common import log
from decapod_common.models import execution
from decapod_common.models import server
from decapod_common.models import task
from decapod_controller import taskpool


CONF = config.make_controller_config()
"""Config."""

LOG = log.getLogger(__name__)
"""Logger."""

SHUTDOWN_EVENT = threading.Event()
"""Event which should be set by signal handler."""

TASK_POOL = taskpool.TaskPool(CONF["controller"]["worker_threads"])


def main():
    """Daemon main loop."""

    atexit.register(TASK_POOL.stop)