Skip to content

Commit 6070a8a

Browse files
authored
Merge pull request #19 from beclab/fix/hamiunschedulable-reason
feat(notification): app stop reason add insufficient vram
2 parents e92295e + 9377463 commit 6070a8a

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/notification/UsersService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ export class UsersService implements OnModuleDestroy, OnModuleInit {
295295
templateId = 'stopped_evicted';
296296
} else if (reason == 'InitFailed') {
297297
templateId = 'stopped_init_failed';
298+
} else if (reason == 'HamiUnschedulable') {
299+
templateId = 'stopped_hami_unschedulable';
298300
}
299301

300302
await this.natsClientPublish(

src/prisma/seeds.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,32 @@ export const TemplateList = [
392392
user: '',
393393
status: ActiveStatus.Active
394394
},
395+
{
396+
topic: MessageTopic.Notification,
397+
name: 'Application Stopped',
398+
appId: 'market',
399+
appName: 'Market',
400+
appTemplateId: 'stopped_hami_unschedulable',
401+
defaultLanguage: 'en-US',
402+
content: {
403+
create: [
404+
{
405+
language: 'en-US',
406+
title: 'App closed',
407+
body: '{{title}} has stopped. Cause: insufficient vram.'
408+
},
409+
{
410+
language: 'zh-CN',
411+
title: '应用已关闭',
412+
body: '{{title}} 已停止运行。原因:显存不足。'
413+
}
414+
]
415+
},
416+
variables: ['title'],
417+
level: Level.Info,
418+
user: '',
419+
status: ActiveStatus.Active
420+
},
395421
{
396422
topic: MessageTopic.Notification,
397423
name: 'Application Resumed',

0 commit comments

Comments
 (0)