feat: exorcise entity framework core from most responders
This commit is contained in:
parent
33b78a7ac5
commit
5891f28f7c
32 changed files with 743 additions and 145 deletions
|
|
@ -13,7 +13,7 @@
|
|||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
using Catalogger.Backend.Database;
|
||||
using Catalogger.Backend.Database.Dapper.Repositories;
|
||||
using Catalogger.Backend.Database.Queries;
|
||||
|
||||
namespace Catalogger.Backend.Services;
|
||||
|
|
@ -34,7 +34,8 @@ public class BackgroundTasksService(ILogger logger, IServiceProvider services) :
|
|||
_logger.Information("Running once per minute periodic tasks");
|
||||
|
||||
await using var scope = services.CreateAsyncScope();
|
||||
var messageRepository = scope.ServiceProvider.GetRequiredService<MessageRepository>();
|
||||
await using var messageRepository =
|
||||
scope.ServiceProvider.GetRequiredService<DapperMessageRepository>();
|
||||
|
||||
var (msgCount, ignoredCount) = await messageRepository.DeleteExpiredMessagesAsync();
|
||||
if (msgCount != 0 || ignoredCount != 0)
|
||||
|
|
@ -43,7 +44,7 @@ public class BackgroundTasksService(ILogger logger, IServiceProvider services) :
|
|||
"Deleted {Count} messages and {IgnoredCount} ignored message IDs older than {MaxDays} days old",
|
||||
msgCount,
|
||||
ignoredCount,
|
||||
MessageRepository.MaxMessageAgeDays
|
||||
DapperMessageRepository.MaxMessageAgeDays
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue