Skip to content
Browse files

revert 7e2c188, restoring tilemill server restart (refs #1121)- worka…

…round for #1180
  • Loading branch information...
1 parent b1981af commit 69ef26fa26c93253f896539e1fbecada4e4faddb @springmeyer springmeyer committed Jan 20, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 models/Project.server.bones
View
12 models/Project.server.bones
@@ -276,7 +276,17 @@ function loadProjectAll(model, callback) {
// Destroy a project. `rm -rf` equivalent for the project directory.
function destroyProject(model, callback) {
var modelPath = path.resolve(path.join(settings.files, 'project', model.id));
- rm(modelPath, callback);
+ // Workaround to access denied error on Windows when mapnik has
+ // open file handles to a data file in a project that needs to
+ // be deleted. Stopgap is to kill the tileserver, delete the project
+ // and let the tileserver start back up on its own.
+ if (process.platform === 'win32') {
+ request.post({ url:'http://'+settings.tileUrl+'/restart' }, function(err) {
+ rm(modelPath, callback);
+ });
+ } else {
+ rm(modelPath, callback);
+ }
}
// Save a project. Creates a subdirectory per project and splits out

0 comments on commit 69ef26f

Please sign in to comment.
Something went wrong with that request. Please try again.