swiftmailer/swiftmailer — Issue #168: unlink error in DiskKeyCache.php
Author: andredelorme
Created: 2012-02-29 17:08:26+00:00
State: open

I use multiple processes to send e-mails with SwiftMailer, sometimes this error occours:

PHP Error[2]: unlink(/tmp/4f4de7ee5a63c/body): No such file or directory
in file .../lib/classes/Swift/KeyCache/DiskKeyCache.php at line 241

Anyone know what could be the problem?
Is it possible that since I have more than one command line PHP scripts running, one delete this file and when another try to delete again this error happens?

The 4f4de7ee5a63c part is a random number generated? Maybe, since I have a cron job that every 1 minute 3 processes are executed, after some executions the same number is generated after a while.

Why not use the @ operator, like this:

@unlink($this->_path . '/' . $nsKey . '/' . $itemKey);