|
@@ -1,6 +1,7 @@
|
|
|
var logging = require("./logging");
|
|
|
var node_redis = require("redis");
|
|
|
var config = require("./config");
|
|
|
+var path = require("path");
|
|
|
var url = require("url");
|
|
|
var fs = require("fs");
|
|
|
|
|
@@ -39,17 +40,17 @@ function connect_redis() {
|
|
|
// the helms file is ignored because we only need 1 file to read/write from
|
|
|
function update_file_date(rid, skin_hash) {
|
|
|
if (skin_hash) {
|
|
|
- var path = config.faces_dir + skin_hash + ".png";
|
|
|
- fs.exists(path, function(exists) {
|
|
|
+ var face_path = path.join(__dirname, "..", config.faces_dir, skin_hash + ".png");
|
|
|
+ fs.exists(face_path, function(exists) {
|
|
|
if (exists) {
|
|
|
var date = new Date();
|
|
|
- fs.utimes(path, date, date, function(err) {
|
|
|
+ fs.utimes(face_path, date, date, function(err) {
|
|
|
if (err) {
|
|
|
logging.error(rid, "Error:", err.stack);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- logging.error(rid, "tried to update", path + " date, but it does not exist");
|
|
|
+ logging.error(rid, "tried to update", face_path + " date, but it does not exist");
|
|
|
}
|
|
|
});
|
|
|
}
|