def call_create_conf(sender, instance, **kwargs):
    if instance.is_active is True:
        create_conf_file(instance.id)
        time.sleep(1)
        ui.utils.reload_config()
        ui.utils.add_process_group(instance.id)
    else:
        ui.utils.remove_process_group(instance.id)
        delete_conf_file(instance.id)
Beispiel #2
0
def call_create_conf(sender, instance, **kwargs):
    # Remove and (in the case of an active filter) re-add
    # the supervisor process group.  Otherwise the configuration
    # file updates are ignored by supervisor.
    #
    # TODO: Consider not just swallowing the condition
    # where Supervisor isn't running
    if os.path.exists(settings.SUPERVISOR_UNIX_SOCKET_FILE):
        ui.utils.remove_process_group(instance.id)
        if instance.is_active is True:
            create_conf_file(instance.id)
            time.sleep(1)
            ui.utils.reload_config()
            ui.utils.add_process_group(instance.id)
        else:
            delete_conf_file(instance.id)
def call_delete_conf(sender, instance, **kwargs):
    delete_conf_file(instance.id)
    ui.utils.remove_process_group(instance.id)
Beispiel #4
0
def call_delete_conf(sender, instance, **kwargs):
    # It might be okay in the case of deleting,
    # to swallow the condition where Supervisor isn't running.
    if os.path.exists(settings.SUPERVISOR_UNIX_SOCKET_FILE):
        delete_conf_file(instance.id)
        ui.utils.remove_process_group(instance.id)
Beispiel #5
0
def call_delete_conf(sender, instance, **kwargs):
    delete_conf_file(instance.id)
Beispiel #6
0
def call_create_conf(sender, instance, **kwargs):
    if instance.is_active is True:
        call_command('createconf', twitterfilter=instance.id)
    else:
        delete_conf_file(instance.id)
def call_delete_conf(sender, instance, **kwargs):
    delete_conf_file(instance.id)
def call_create_conf(sender, instance, **kwargs):
    if instance.is_active is True:
        call_command('createconf', twitterfilter=instance.id)
    else:
        delete_conf_file(instance.id)