public SqliteCacheService(SqliteCacheOptions options, ILogger <SqliteCacheService> logger)
 {
     this.options     = options;
     this.logger      = logger;
     databaseInMemory = options.DatabaseDir == ":memory:";
     if (!databaseInMemory)
     {
         this.databasePath = Path.Combine(options.DatabaseDir, "imageflow_cache.sqlite");
     }
     killer = new CancellationTokenSource();
 }
        public static IServiceCollection AddImageflowSqliteCache(this IServiceCollection services, SqliteCacheOptions options)
        {
            services.AddSingleton <ISqliteCache>((container) =>
            {
                var logger = container.GetRequiredService <ILogger <SqliteCacheService> >();
                return(new SqliteCacheService(options, logger));
            });

            services.AddHostedService <SqliteCacheHostedServiceProxy>();
            return(services);
        }