Skip to content

Commit

Permalink
fix: 追加日志推送错误
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-cn committed Jan 2, 2024
1 parent 4b100a0 commit c953fc4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ export class App extends Koa {
async start() {
this.httpServer.listen(this.config.port)
const fileListener=(e)=>{
if(e==='change') this.ws.clients.forEach(client=>{
if(e==='change') this.ws.clients.forEach(async (client)=>{

client.send(JSON.stringify({
event:'system.log',
data:readLine(1,App.logFile)
data:await readLine(1,App.logFile)
}))
})
}
Expand Down

0 comments on commit c953fc4

Please sign in to comment.