first commit
This commit is contained in:
commit
c809bb3893
40 files changed
+3836
No files matched your search
+43
@@ -0,0 +1,43 @@
|
||||
import { secrets } from './secret-manager.js';
|
||||
import { MinioClient } from './minio.js';
|
||||
import { NatsClient } from './nats.js';
|
||||
import { FFmpegConverter } from './ffmpeg.js';
|
||||
import { ImageDerivativesGenerator } from './image-derivaties-generator.js';
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
console.log('🔐 Secrets loaded');
|
||||
console.log(secrets)
|
||||
|
||||
// Initialize clients
|
||||
const minioClient = new MinioClient();
|
||||
const natsClient = new NatsClient();
|
||||
const ffmpegConverter = new FFmpegConverter();
|
||||
|
||||
// Connect to NATS
|
||||
await natsClient.connect();
|
||||
|
||||
// Create and start the service
|
||||
const generator = new ImageDerivativesGenerator(
|
||||
minioClient,
|
||||
natsClient,
|
||||
ffmpegConverter
|
||||
);
|
||||
|
||||
await generator.start();
|
||||
|
||||
// Handle graceful shutdown
|
||||
const shutdown = async () => {
|
||||
await generator.stop();
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
process.on('SIGINT', shutdown);
|
||||
process.on('SIGTERM', shutdown);
|
||||
} catch (error) {
|
||||
console.error('❌ Failed to start service:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in new issue
Block a user