@@ -26,7 +26,7 @@ export class InstanceService {
26
26
private readonly storageService : StorageService ,
27
27
private readonly databaseService : DatabaseService ,
28
28
private readonly prisma : PrismaService ,
29
- ) { }
29
+ ) { }
30
30
31
31
async create ( app : Application ) {
32
32
const appid = app . appid
@@ -176,18 +176,23 @@ export class InstanceService {
176
176
} ,
177
177
} )
178
178
const { deployment } = await this . get ( app )
179
- deployment . spec = await this . makeDeploymentSpec ( app , deployment . spec . template . metadata . labels )
179
+ deployment . spec = await this . makeDeploymentSpec (
180
+ app ,
181
+ deployment . spec . template . metadata . labels ,
182
+ )
180
183
const region = await this . regionService . findByAppId ( app . appid )
181
184
const appsV1Api = this . clusterService . makeAppsV1Api ( region )
182
185
const namespace = GetApplicationNamespaceByAppId ( app . appid )
183
- const res = await appsV1Api . replaceNamespacedDeployment ( app . appid , namespace , deployment )
186
+ const res = await appsV1Api . replaceNamespacedDeployment (
187
+ app . appid ,
188
+ namespace ,
189
+ deployment ,
190
+ )
184
191
185
192
this . logger . log ( `restart k8s deployment ${ res . body ?. metadata ?. name } ` )
186
-
187
193
}
188
194
189
195
async makeDeploymentSpec ( app : any , labels : any ) : Promise < V1DeploymentSpec > {
190
-
191
196
// prepare params
192
197
const limitMemory = app . bundle . resource . limitMemory
193
198
const limitCpu = app . bundle . resource . limitCPU
@@ -227,8 +232,9 @@ export class InstanceService {
227
232
} ,
228
233
{ name : 'DEPENDENCIES' , value : dependencies_string } ,
229
234
{
230
- name : 'RESTART_AT' , value : new Date ( ) . getTime ( ) . toString ( ) ,
231
- }
235
+ name : 'RESTART_AT' ,
236
+ value : new Date ( ) . getTime ( ) . toString ( ) ,
237
+ } ,
232
238
]
233
239
234
240
// merge env from app configuration, override if exists
0 commit comments