Browse Source

Lower times to resolve windows issues.

* Lower the duration and sleep() time to reduce issues on windows.
* Clearing the file handle out fixes issues on windows where file
  handles would persist after the file was deleted.
mark_story 11 years ago
parent
commit
c45868e871
2 changed files with 3 additions and 2 deletions
  1. 1 0
      src/Cache/Engine/FileEngine.php
  2. 2 2
      tests/TestCase/Cache/Engine/FileEngineTest.php

+ 1 - 0
src/Cache/Engine/FileEngine.php

@@ -152,6 +152,7 @@ class FileEngine extends CacheEngine {
 		if ($this->_config['lock']) {
 			$this->_File->flock(LOCK_UN);
 		}
+		$this->_File = null;
 
 		return $success;
 	}

+ 2 - 2
tests/TestCase/Cache/Engine/FileEngineTest.php

@@ -191,7 +191,7 @@ class FileEngineTest extends TestCase {
  * @return void
  */
 	public function testClear() {
-		$this->_configCache(['duration' => 1]);
+		$this->_configCache(['duration' => 0]);
 
 		$data = 'this is a test of the emergency broadcasting system';
 		Cache::write('serialize_test1', $data, 'file_test');
@@ -201,7 +201,7 @@ class FileEngineTest extends TestCase {
 		$this->assertTrue(file_exists(TMP . 'tests/cake_serialize_test2'));
 		$this->assertTrue(file_exists(TMP . 'tests/cake_serialize_test3'));
 
-		sleep(2);
+		sleep(1);
 		$result = Cache::clear(true, 'file_test');
 		$this->assertTrue($result);
 		$this->assertFalse(file_exists(TMP . 'tests/cake_serialize_test1'));