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

An error occurred when deleting the cache file #418

Open
dadkhah-dev opened this issue Oct 9, 2024 · 1 comment
Open

An error occurred when deleting the cache file #418

dadkhah-dev opened this issue Oct 9, 2024 · 1 comment

Comments

@dadkhah-dev
Copy link

dadkhah-dev commented Oct 9, 2024

When multiple requests are sent to the server at the same time. The following error occurs.

Untitled

Why is it not checked that the file exists when the file is about to be deleted?
Is it possible that an earlier process has deleted the file in processes that occur simultaneously?

while (false !== ($filename = readdir($dh))) {
            if (empty($filename)) {
                continue;
            }
            if ($filename[0] === '.') {
                continue;
            }
            $key = substr($filename, 0, strlen($filename) - 4);
            if ($this->isOld($key, $config)) {
                unlink($dir . '/' . $filename);
            }
        }

Why package version 4.17 registered but cache file version is 4.15?

class HTMLPurifier_Config
{

    /**
     * HTML Purifier's version
     * @type string
     */
    public $version = '4.17.0';
    
}

Web server: nginx
Php : 8.2
Package: "ezyang/htmlpurifier": "^4.17.0"

@dadkhah-dev
Copy link
Author

No error occurs when I make the following change.

public $version = '4.17.0'; ==============> public $version = '4.15.0';

Does anyone have an idea to fix this problem?

@dadkhah-dev dadkhah-dev changed the title Error on remove cache fil Error on remove cache file Oct 9, 2024
@dadkhah-dev dadkhah-dev changed the title Error on remove cache file Error when remove cache file Oct 9, 2024
@dadkhah-dev dadkhah-dev changed the title Error when remove cache file An error occurred when deleting the cache file Oct 9, 2024
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

No branches or pull requests

1 participant