Skip to content

Commit

Permalink
优化同步丢失文件错误
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Aug 26, 2021
1 parent b38d922 commit 59f9f90
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {spawn} from 'child_process'
import * as colors from 'colors/safe'
import * as express from 'express'
import {copy, ftruncate, mkdtemp, open, outputFile, pathExists, readdir, readFile, stat, unlink} from 'fs-extra'
import got, {Got} from 'got'
import got, {Got, HTTPError} from 'got'
import {createServer, Server} from 'http'
import {clone, template} from 'lodash'
import {tmpdir} from 'os'
Expand Down Expand Up @@ -133,6 +133,11 @@ export class Cluster {
this.counters.hits++
})
} catch (err) {
if (err instanceof HTTPError) {
if (err.response.statusCode === 404) {
return next()
}
}
return next(err)
}
})
Expand Down

0 comments on commit 59f9f90

Please sign in to comment.