Skip to content

Commit

Permalink
fix: remove caching on network post
Browse files Browse the repository at this point in the history
post was only used by audit plugin. Since
post was used with same graphql url but options
to specify the query any cached value would
result in incorrect result from previous query.
Remove caching so that we get the right answer
for each request.

Signed-off-by: Michael Dawson <mdawson@devrus.com>
  • Loading branch information
mhdawson committed Oct 20, 2022
1 parent 13d5d6b commit 41c3e01
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,8 @@ const fetchGithub = async (target, token, override = false) => {
};

const post = async (url, options = {}) => {
// check if we already have the response in cache
if (cache.has(url)) return cache.get(url).data;

// don't cache since the options need to be considered
const response = await axios.post(url, options.body, options);

// save response in cache for future usage
cache.set(url, response);
return response.data;
};

Expand Down

0 comments on commit 41c3e01

Please sign in to comment.