feat(multipart): Implement full multipart upload support with persistent manager, periodic cleanup, and API integration
This commit is contained in:
@@ -78,11 +78,19 @@ export class Smarts3Server {
|
||||
maxMetadataSize: 2048,
|
||||
requestTimeout: 300000,
|
||||
},
|
||||
multipart: {
|
||||
expirationDays: 7,
|
||||
cleanupIntervalMinutes: 60,
|
||||
},
|
||||
};
|
||||
|
||||
this.logger = new Logger(this.config.logging);
|
||||
this.store = new FilesystemStore(this.options.directory);
|
||||
this.multipart = new MultipartUploadManager(this.options.directory);
|
||||
this.multipart = new MultipartUploadManager(
|
||||
this.options.directory,
|
||||
this.config.multipart.expirationDays,
|
||||
this.config.multipart.cleanupIntervalMinutes
|
||||
);
|
||||
this.router = new S3Router();
|
||||
this.middlewares = new MiddlewareStack();
|
||||
|
||||
@@ -297,6 +305,9 @@ export class Smarts3Server {
|
||||
// Initialize multipart upload manager
|
||||
await this.multipart.initialize();
|
||||
|
||||
// Start multipart cleanup task
|
||||
this.multipart.startCleanupTask();
|
||||
|
||||
// Clean slate if requested
|
||||
if (this.options.cleanSlate) {
|
||||
await this.store.reset();
|
||||
@@ -337,6 +348,9 @@ export class Smarts3Server {
|
||||
return;
|
||||
}
|
||||
|
||||
// Stop multipart cleanup task
|
||||
this.multipart.stopCleanupTask();
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
this.httpServer!.close((err?: Error) => {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user