From f5149dfaba64c62f0a9ea6deab600b3d4d9b0f39 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Fri, 19 Nov 2021 12:13:45 -0500 Subject: Move file caching logic to new FileCache service Also: removes the -re ffmpeg option. If this option is passed, ffmpeg won't write to fs-capacitor (and the cache file) as fast as possible. In other words, the cache file won't finish writing until the entire stream has been played. --- src/index.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index 5bf5bab..383faef 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ import {TYPES} from './types.js'; import Bot from './bot.js'; import {sequelize} from './utils/db.js'; import Config from './services/config.js'; +import FileCacheProvider from './services/file-cache.js'; const bot = container.get(TYPES.Bot); @@ -18,5 +19,7 @@ const bot = container.get(TYPES.Bot); await sequelize.sync({alter: true}); + await container.get(TYPES.FileCache).cleanup(); + await bot.listen(); })(); -- cgit v1.2.3