fix job timed out error

This commit is contained in:
peter
2020-02-10 20:31:23 +01:00
parent 070d3d254b
commit dad45d4f56
3 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -23,15 +23,15 @@ implements RPCExporter{
}
]
publish = ( topic: string, msg: UpdateType ) => {
publish = async (topic: string, msg: UpdateType ) => {
if(!this.subs[topic]) this.subs[topic] = {}
Object.entries(this.subs[topic]).forEach(([uuid, callback]:[string, Function]) => {
await Promise.all(Object.entries(this.subs[topic]).map(async ([uuid, callback]:[string, Function]) => {
try{
callback(msg)
await callback(msg)
}catch(e){
delete this.subs[topic][uuid]
}
})
}))
}
subscribe = async (topic:string, callback:(p:UpdateType)=>any) : Promise<SubscriptionResponse<{topic: string}>> => {
+5 -5
View File
@@ -38,14 +38,14 @@ implements FrontworkComponent<ShoutboxIfc, ShoutboxFeatureIfc>, IShoutbox{
this.log.push(msg)
}
private broadcast = (uuid:string, msg: ShoutMessage) => {
Object.values(this.subs).forEach((cb:any) => {
private broadcast = async (uuid:string, msg: ShoutMessage) => {
await Promise.all(Object.values(this.subs).map(async (callback:any) => {
try{
cb(msg)
await callback(msg)
}catch(e){
this.unsubscribe(uuid)
delete this.subs[uuid]
}
})
}))
}
getFeed = async () : Promise<ShoutMessage[]> => {
@@ -27,9 +27,9 @@ export class PagesLayoutComponent implements AfterContentInit{
title: 'Loot Rules',
link: '/frontcraft/rules',
},{
icon: "shield",
title: 'Armory',
link: '/frontcraft/armory'
icon: "shield",
title: 'Armory',
link: '/frontcraft/armory'
}]
constructor(