Skip to content

CacheServiceeProvider tenant identification for background processes #1006

Description

@juhasev

Hyn/Tenant 5.6 the example uses $app['config']['driver'] to get the tenant UUID, however it is always null. Does anybody know how to detect the Tenant in CLI operations like background processes? I have some background processes that need to clear Cached entries.

public function boot()
{
    Cache::extend('redis_tenancy', function ($app) {
        if (PHP_SAPI === 'cli') {
            $uuid = $app['config']['driver'];
        }

        return Cache::repository(new RedisStore(
                $app['redis'],
                $uuid,
                $app['config']['cache.stores.redis.connection']
            ));
    });
} 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions