Skip to content
Snippets Groups Projects
Commit cbaf4259 authored by Chris Smith's avatar Chris Smith
Browse files

Fix for FS#1334, see also FS#1090

FS#1090 ensured DW would never rebuild instructions in the same run by forcing subsequent
instruction requests to use the version cached on the first request.  That introduced problems
when the caching of the instructions failed (FS#1334).  This patch allows subsequent rebuilds
when cache storage failed.

darcs-hash:20080223025539-d26fc-26202a049a6969816553d950a2bb8f71a02ae76e.gz
parent 85d03f68
No related branches found
No related tags found
No related merge requests found
......@@ -105,10 +105,10 @@ class cache {
* cache $data
*
* @param string $data the data to be cached
* @return none
* @return bool true on success, false otherwise
*/
function storeCache($data) {
io_savefile($this->cache, $data);
return io_savefile($this->cache, $data);
}
/**
......@@ -286,6 +286,6 @@ class cache_instructions extends cache_parser {
}
function storeCache($instructions) {
io_savefile($this->cache,serialize($instructions));
return io_savefile($this->cache,serialize($instructions));
}
}
......@@ -183,8 +183,11 @@ function p_cached_instructions($file,$cacheonly=false,$id='') {
} else if (@file_exists($file)) {
// no cache - do some work
$ins = p_get_instructions(io_readfile($file));
$cache->storeCache($ins);
$run[$file] = true; // we won't rebuild these instructions in the same run again
if ($cache->storeCache($ins)) {
$run[$file] = true; // we won't rebuild these instructions in the same run again
} else {
msg('Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.',-1);
}
return $ins;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment