Skip to content

FilePathCache throws exceptions almost every release #191

@rodmcnew

Description

@rodmcnew

Almost every time we release we get errors from the following line for random css and js files.
https://github.com/RWOverdijk/AssetManager/blob/master/src/AssetManager/Cache/FilePathCache.php#L94

I believe this happens because more than one person is asking for the same file at the same time. Perhaps two php threads are trying to write the same file at the same time.

I had to change it to this in our local version to prevent errors in our logs every release:

        if (@file_put_contents($tmpFilePath, $value, LOCK_EX) === false) {
            //THIS IS THE MODIFICATION THAT PREVENTS ERRORS DURING RELEASES
            return;
//            throw new RuntimeException('Unable to write file ' . $this->cachedFile());
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions