leonibr / community-extensions-cache-postgres

A PostgreSQL Implementation of IDistributedCache interface. Using Postgresql as distributed cache in Asp.Net Core. NetStandard 2.0
59 stars 17 forks source link

Remove dependency on HostBuilders #28

Closed Wautvda closed 2 years ago

Wautvda commented 2 years ago

The DI wiring of this nuget through AddDistributedPostgreSqlCache depends on the registration of IHostApplicationLifetime for the DatabaseExpiredItemsRemoverLoop. This is usefull when registering applications through the hostbuilder. We are also depending on AWS lambdas which don't have the luxury of hostbuilders (unfortunately) and therefor lacking IHostApplicationLifetime. A solution could be an optional dependency to inject.

leonibr commented 2 years ago

try the new bits of version 3.1.2, and let me know,

Wautvda commented 2 years ago

Seems to be working for us, thanks! Next time I'll make a PR. But nice job!