Skip to content

Commit

Permalink
removed timeouts and console debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ ONeal committed May 20, 2012
1 parent 6ce2472 commit b1dd51c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"tmp": "/tmp"
, "storageDir": __dirname + "/files"
, "client": __dirname + "/public"
, "databaseStrategy": "json"
//, "databaseStrategy": "json"
}
, app
, attributeName
Expand Down
22 changes: 7 additions & 15 deletions server/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@
});
}
// If metadata exists, then move the file and update the metadata with the new path
setTimeout(function () {
res = self._fileDb.put(onStored, formPart.value[0]);
}, 1000);
res = self._fileDb.put(onStored, formPart.value[0]);
});
};

Expand Down Expand Up @@ -196,14 +194,11 @@

, 'loadend': function (json, res, callback) {
console.log('\njson is\n', json);
// because sometimes loadend fires too fast?
setTimeout(function () {
try {
callback(json, res);
} catch ( err ) {
console.error( 'error', err.stack );
}
}, 1000);
try {
callback(json, res);
} catch ( err ) {
console.error( 'error', err.stack );
}
}

, 'error': function (err) {
Expand All @@ -222,10 +217,7 @@
var args = Array.prototype.slice.call(arguments)
;

console.log('parser args', args);
setTimeout(function () {
self.handleUploadedFiles.apply(self, args);
}, 1000);
self.handleUploadedFiles.apply(self, args);
});
};

Expand Down

0 comments on commit b1dd51c

Please sign in to comment.