Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmelnikow committed Apr 30, 2020
1 parent 78b9c44 commit 3aea519
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/base-service/base-non-memory-caching.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'

const makeBadge = require('../../badge-maker/lib/make-badge')
const BaseService = require('./base')
const { MetricHelper } = require('./metric-helper')
const { setCacheHeaders } = require('./cache-headers')
const { makeSend } = require('./legacy-result-sender')
const { makeBadgeOrJson } = require('./make-badge-or-json')
const coalesceBadge = require('./coalesce-badge')
const { prepareRoute, namedParamsForMatch } = require('./route')

Expand Down Expand Up @@ -57,7 +57,7 @@ module.exports = class NonMemoryCachingBaseService extends BaseService {
const format = (match.slice(-1)[0] || '.svg').replace(/^\./, '')
badgeData.format = format

const svg = makeBadge(badgeData)
const badgeOrJson = makeBadgeOrJson(badgeData, format)

setCacheHeaders({
cacheHeaderConfig,
Expand All @@ -66,7 +66,7 @@ module.exports = class NonMemoryCachingBaseService extends BaseService {
res: ask.res,
})

makeSend(format, ask.res, end)(svg)
makeSend(format, ask.res, end)(badgeOrJson)

metricHandle.noteResponseSent()
})
Expand Down
6 changes: 3 additions & 3 deletions core/base-service/base-static.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict'

const makeBadge = require('../../badge-maker/lib/make-badge')
const BaseService = require('./base')
const {
serverHasBeenUpSinceResourceCached,
setCacheHeadersForStaticResource,
} = require('./cache-headers')
const { makeSend } = require('./legacy-result-sender')
const { makeBadgeOrJson } = require('./make-badge-or-json')
const { MetricHelper } = require('./metric-helper')
const coalesceBadge = require('./coalesce-badge')
const { prepareRoute, namedParamsForMatch } = require('./route')
Expand Down Expand Up @@ -51,8 +51,8 @@ module.exports = class BaseStaticService extends BaseService {

setCacheHeadersForStaticResource(ask.res)

const svg = makeBadge(badgeData)
makeSend(format, ask.res, end)(svg)
const badgeOrJson = makeBadgeOrJson(badgeData, format)
makeSend(format, ask.res, end)(badgeOrJson)

metricHandle.noteResponseSent()
})
Expand Down

0 comments on commit 3aea519

Please sign in to comment.