config: Make avif images smaller.
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
server: Update logging for aborted connections
This commit is contained in:
parent
4b36820f09
commit
40cc8e0cae
2 changed files with 8 additions and 5 deletions
|
@ -59,15 +59,15 @@ nconf.defaults({
|
||||||
"format": "avif",
|
"format": "avif",
|
||||||
"blur": 10,
|
"blur": 10,
|
||||||
"resize": {
|
"resize": {
|
||||||
"width": 300,
|
"width": 200,
|
||||||
"height": 300,
|
"height": 200,
|
||||||
"fit": "inside",
|
"fit": "inside",
|
||||||
"withoutEnlargement": true,
|
"withoutEnlargement": true,
|
||||||
"kernel": "lanczos3"
|
"kernel": "lanczos3"
|
||||||
},
|
},
|
||||||
"avif": {
|
"avif": {
|
||||||
"quality": 50,
|
"quality": 30,
|
||||||
"effort": 4
|
"effort": 9
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"small": {
|
"small": {
|
||||||
|
|
|
@ -56,6 +56,9 @@ export default class Server {
|
||||||
this.flaska.before(QueryHandler())
|
this.flaska.before(QueryHandler())
|
||||||
|
|
||||||
this.flaska.after(function(ctx) {
|
this.flaska.after(function(ctx) {
|
||||||
|
if (ctx.aborted && ctx.status === 200) {
|
||||||
|
ctx.status = 299
|
||||||
|
}
|
||||||
let ended = new Date().getTime()
|
let ended = new Date().getTime()
|
||||||
var requestTime = ended - ctx.state.started
|
var requestTime = ended - ctx.state.started
|
||||||
|
|
||||||
|
@ -72,7 +75,7 @@ export default class Server {
|
||||||
ctx.log[level]({
|
ctx.log[level]({
|
||||||
duration: requestTime,
|
duration: requestTime,
|
||||||
status: ctx.status,
|
status: ctx.status,
|
||||||
}, `<-- ${status}${ctx.method} ${ctx.url}`)
|
}, (ctx.aborted ? '[ABORT]' : '<--') + ` ${status}${ctx.method} ${ctx.url}`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue