Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

385 adapter the taobaominigame ClearLRU procedure #17230

Open
wants to merge 4 commits into
base: v3.8.5
Choose a base branch
from

Conversation

tangkaikk
Copy link

Re: #

Changelog

Fixes #17040 : taobao Platform can not trigger clearLRU

Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

1.taobao platform will clear tmp folder automatically.
2.when cachecount below 3, it will trigger LRU.
3.zip file, the path maybe is a zipfile.
Copy link

Interface Check Report

This pull request does not change any public interfaces !

return;
let clearCachCount = Math.floor(caches.length / 3);
// 大于3则清理1/3, 小于等于3则全部清理
if(clearCachCount > 3){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use caches.length >= 12 instead of clearCacheCount > 3.

And below, you can use caches.length < 3 instead of clearCacheCount === 0.

This way, when caches.length < 3, you won't need to execute Math.floor(caches.length / 3).

可以使用 caches.length >= 12 代替 clearCacheCount > 3

下面可以使用 caches.length < 3 代替 clearCachCount === 0

这样可以使得当 caches.length < 3 时不用执行 Math.floor(caches.length / 3)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to :
if(caches.length < 3){
console.warn("Due to caching large files in the game, there is insufficient storage space. Now starting forced cleaning.");
}
else{
caches.length = Math.floor(caches.length / 3);
}

if (caches.length === 0) {
cleaning = false;
return;
// 大于3则清理1/3, 小于等于3则全部清理
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use english

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

taobao Platform can not trigger clearLRU
3 participants