fix: clean up registry shutdown
This commit is contained in:
@@ -317,6 +317,15 @@ export class RegistryManager {
|
|||||||
* Stop the registry and smartstorage server
|
* Stop the registry and smartstorage server
|
||||||
*/
|
*/
|
||||||
async stop(): Promise<void> {
|
async stop(): Promise<void> {
|
||||||
|
if (this.registry) {
|
||||||
|
try {
|
||||||
|
this.registry.destroy?.();
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(`Error destroying smartregistry: ${getErrorMessage(error)}`);
|
||||||
|
}
|
||||||
|
this.registry = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.s3Server) {
|
if (this.s3Server) {
|
||||||
try {
|
try {
|
||||||
await this.s3Server.stop();
|
await this.s3Server.stop();
|
||||||
@@ -324,6 +333,7 @@ export class RegistryManager {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(`Error stopping smartstorage: ${getErrorMessage(error)}`);
|
logger.error(`Error stopping smartstorage: ${getErrorMessage(error)}`);
|
||||||
}
|
}
|
||||||
|
this.s3Server = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isInitialized = false;
|
this.isInitialized = false;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user