func NewPubSubCleaner(ctx context.Context, config *redis.Config) (*pubsub.RegistryCleaner, error) {
	pubSubRegistry := &pubsubredis.PubSubRegistry{
		Redis:   redis.New(config.WithNamespace("as", "io", "pubsub")),
		LockTTL: defaultLockTTL,
	}
	if err := pubSubRegistry.Init(ctx); err != nil {
		return nil, shared.ErrInitializeApplicationServer.WithCause(err)
	}
	cleaner := &pubsub.RegistryCleaner{
		PubSubRegistry: pubSubRegistry,
	}
	err := cleaner.RangeToLocalSet(ctx)
	if err != nil {
		return nil, err
	}
	return cleaner, nil
}
NewPubSubCleaner returns a new instance of pubsub RegistryCleaner with a local set of applications.
package commands
import (
	"context"
	"go.thethings.network/lorawan-stack/v3/cmd/internal/shared"
	as "go.thethings.network/lorawan-stack/v3/pkg/applicationserver"
	"go.thethings.network/lorawan-stack/v3/pkg/applicationserver/io/packages"
	packageredis "go.thethings.network/lorawan-stack/v3/pkg/applicationserver/io/packages/redis"
	"go.thethings.network/lorawan-stack/v3/pkg/applicationserver/io/pubsub"
	pubsubredis "go.thethings.network/lorawan-stack/v3/pkg/applicationserver/io/pubsub/redis"
	"go.thethings.network/lorawan-stack/v3/pkg/applicationserver/io/web"
	webredis "go.thethings.network/lorawan-stack/v3/pkg/applicationserver/io/web/redis"
	asredis "go.thethings.network/lorawan-stack/v3/pkg/applicationserver/redis"
	"go.thethings.network/lorawan-stack/v3/pkg/redis"
)