1
1
/**
2
2
* OpenDistributedFileStorage
3
- * Copyright (C) 2024 Amir Czwink ([email protected] )
3
+ * Copyright (C) 2024-2025 Amir Czwink ([email protected] )
4
4
*
5
5
* This program is free software: you can redistribute it and/or modify
6
6
* it under the terms of the GNU Affero General Public License as published by
16
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
* */
18
18
import "dotenv/config" ;
19
- import fs from "fs" ;
20
19
import http from "http" ;
21
20
import { AbsURL , OpenAPI } from "acts-util-core" ;
22
21
import { Factory , GlobalInjector , HTTP } from "acts-util-node" ;
23
22
import { APIRegistry } from "acts-util-apilib" ;
24
23
import { DBConnectionsManager } from "./data-access/DBConnectionsManager" ;
25
- import { CONFIG_AUDIENCE , CONFIG_OIDP_ENDPOINT , CONFIG_ORIGIN , CONFIG_PORT , CONFIG_ROOTDIR , CONFIG_UPLOADDIR } from "./env" ;
24
+ import { CONFIG_AUDIENCE , CONFIG_OIDP_ENDPOINT , CONFIG_ORIGIN , CONFIG_PORT , CONFIG_UPLOADDIR } from "./env" ;
26
25
import { StorageBackendsManager } from "./services/StorageBackendsManager" ;
27
26
import { MessagingService } from "./services/MessagingService" ;
28
27
import { JobOrchestrationService } from "./services/JobOrchestrationService" ;
@@ -34,8 +33,6 @@ import { StorageBlocksManager } from "./services/StorageBlocksManager";
34
33
import { FileUploadProcessor } from "./services/FileUploadProcessor" ;
35
34
import { GarbageColletor } from "./services/GarbageColletor" ;
36
35
37
- const crashDetectionPath = CONFIG_ROOTDIR + "/crash_check" ;
38
-
39
36
async function DownloadPublicKey ( )
40
37
{
41
38
const sender = new HTTP . RequestSender ( ) ;
@@ -137,26 +134,18 @@ async function BootstrapServer()
137
134
console . log ( "Shutting server down..." ) ;
138
135
GlobalInjector . Resolve ( DBConnectionsManager ) . Close ( ) ;
139
136
GlobalInjector . Resolve ( MessagingService ) . Close ( ) ;
140
- fs . unlinkSync ( crashDetectionPath ) ;
141
137
server . close ( ) ;
142
138
} ) ;
143
139
}
144
140
145
141
function BootstrapService ( )
146
142
{
147
- if ( fs . existsSync ( crashDetectionPath ) )
148
- {
149
- console . log ( "Service did crash :S" ) ;
150
- process . exit ( 1 ) ;
151
- return ;
152
- }
153
143
process . on ( "uncaughtException" , ( error , origin ) => {
154
144
console . log ( "Unhandled exception: " , error , origin ) ;
155
145
} ) ;
156
146
process . on ( "unhandledRejection" , ( reason , promise ) => {
157
147
console . log ( "Unhandled rejection: " , reason , promise ) ;
158
148
} ) ;
159
- fs . writeFileSync ( crashDetectionPath , "" ) ;
160
149
161
150
BootstrapServer ( ) ;
162
151
}
0 commit comments