Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Release v1.2.11 - Fix: Topgearsubmit URL issue#365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
luizrrodrigues merged 13 commits intomasterfromdevelop
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
f52482f
removed caching while getting groups
bountyC0d3rNov 30, 2022
fa3e79f
Merge pull request #355 from bountyC0d3r/plat-1703-tg-submit-url-issue
rakibansaryNov 30, 2022
2c779de
Revert "removed caching while getting groups"
luizrrodriguesFeb 17, 2023
fd71be9
Merge pull request #359 from topcoder-platform/revert-355-plat-1703-t…
luizrrodriguesFeb 17, 2023
9730888
changes for the oldId
bountyC0d3rMar 3, 2023
38a21db
Merge pull request #361 from bountyC0d3r/develop
luizrrodriguesMar 6, 2023
492fea1
update for the group seq
bountyC0d3rMar 6, 2023
469aedd
Merge pull request #363 from bountyC0d3r/develop
luizrrodriguesMar 6, 2023
8c9fc49
ci: bump test version
luizrrodriguesMar 6, 2023
83b35ed
Merge pull request #362 from topcoder-platform/PROD-4120
luizrrodriguesMar 8, 2023
5e6a4d3
ci: bump test version
luizrrodriguesMar 8, 2023
90807dd
ci: remove tag test-release
luizrrodriguesMar 8, 2023
c683008
bump version
luizrrodriguesMar 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "1.2.10",
"version": "1.2.11",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
29 changes: 10 additions & 19 deletionssrc/services/groups.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -319,28 +319,19 @@ class GroupService {
* cache. Defaults to 5 minutes.
* @return {Promise} Resolves to ID array.
*/
async getGroupTreeIds(rootGroupId, maxage = 5 * 60 * 1000) {
const now = Date.now();
const cache = this.private.cache.groupTreeIds;
async getGroupTreeIds(rootGroupId) {
const rootGroupURL = `/groups/${rootGroupId}`;
const rootGroupRes = await this.private.api.get(rootGroupURL);
const rootGroupJSON = await handleApiResponse(rootGroupRes);

/* Clean-up: removes stale records from the cache. */
const CLEAN_UP_INTERVAL = 24 * 60 * 60 * 1000; // 1 day in ms.
if (now - cache.lastCleanUp > CLEAN_UP_INTERVAL) {
_.forOwn(cache, ({ timestamp }, key) => {
if (now - timestamp > CLEAN_UP_INTERVAL) delete cache[key];
});
cache.lastCleanUp = now;
}
const url = `/groups/${rootGroupJSON.id}?flattenGroupIdTree=true`;
const response = await this.private.api.get(url);
const responseJSON = await handleApiResponse(response);

/* If result is found in cache, and is fresh enough, return it. */
const cached = cache[rootGroupId];
if (cached && now - cached.timestamp < maxage) return _.clone(cached.data);
const treeIds = responseJSON.flattenGroupIdTree;
treeIds.unshift(responseJSON.id);

/* Otherwise, fetch result from the API, write it to the cache, and
* finally return that. */
const res = reduceGroupIds(await this.getGroup(rootGroupId));
cache[rootGroupId] = { data: res, timestamp: now };
return _.clone(res);
return treeIds;
}

/**
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp