Skip to content

Commit

Permalink
Merge d5d216b into e085e83
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarangoni authored Feb 25, 2021
2 parents e085e83 + d5d216b commit a81c66d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion __fixtures__/unit/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ module.exports = {
},
probotContext: {
config: jest.fn().mockResolvedValue(options.configJson)
}
},
globalSettings: {}
}
},

Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CHANGELOG
=====================================

| February 25, 2021 : fix: Correct use of cache env
| February 12, 2021 : feat: Implemented redis as a dependency to the helm-chart
| February 10, 2021 : feat: global cache manager `#502 <https://github.com/mergeability/mergeable/pull/502>`_
| February 10, 2021 : feat: Implement and/or filters support `#496 <https://github.com/mergeability/mergeable/pull/504>`_
Expand Down
11 changes: 7 additions & 4 deletions lib/filters/options_processor/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ class Topics {
}

const repoTopics = async (context) => {
if (process.env.USE_CONFIG_CACHE) {
let names = await cacheManager.get(`${context.payload.full_name}#repoTopics`)
let repo = context.repo()
const globalSettings = context.globalSettings

if (globalSettings.use_config_cache !== undefined && globalSettings.use_config_cache === true) {
let names = await cacheManager.get(`${repo.owner}/${repo.repo}/topics`)
if (names) {
return names
}
Expand All @@ -24,8 +27,8 @@ const repoTopics = async (context) => {
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name
}).then(response => {
if (process.env.USE_CONFIG_CACHE) {
cacheManager.set(`${context.payload.full_name}#repoTopics`, response.data.names)
if (globalSettings.use_config_cache !== undefined && globalSettings.use_config_cache === true) {
cacheManager.set(`${repo.owner}/${repo.repo}/topics`, response.data.names)
}
return response.data.names
})
Expand Down

0 comments on commit a81c66d

Please sign in to comment.