Ejemplo n.º 1
0
def vacuum_schemas():
    """Vacuum all schemas."""
    tenants = Tenant.objects.values("schema_name")
    schema_names = [
        tenant.get("schema_name") for tenant in tenants
        if (tenant.get("schema_name") and tenant.get("schema_name") != "public"
            )
    ]

    for schema_name in schema_names:
        LOG.info("Scheduling VACUUM task for %s", schema_name)
        vacuum_schema.delay(schema_name)
Ejemplo n.º 2
0
def vacuum_schemas():
    """Vacuum all schemas."""
    tenants = Tenant.objects.values('schema_name')
    schema_names = [
        tenant.get('schema_name') for tenant in tenants
        if (tenant.get('schema_name') and tenant.get('schema_name') != 'public'
            )
    ]

    for schema_name in schema_names:
        LOG.info('Scheduling VACUUM task for %s', schema_name)
        vacuum_schema.delay(schema_name)