fix jshint

This commit is contained in:
antelle 2016-03-27 10:46:43 +03:00
parent d6625d2825
commit f83e39b1aa
9 changed files with 18 additions and 21 deletions

View File

@ -3,16 +3,12 @@
var Launcher = require('../comp/launcher');
var Storage = {
file: new (require('./storage-file'))(),
dropbox: new (require('./storage-dropbox'))(),
webdav: new (require('./storage-webdav'))(),
gdrive: new (require('./storage-gdrive'))(),
onedrive: new (require('./storage-onedrive'))(),
cache: new (Launcher ? require('./storage-file-cache') : require('./storage-cache'))()
file: require('./storage-file'),
dropbox: require('./storage-dropbox'),
webdav: require('./storage-webdav'),
gdrive: require('./storage-gdrive'),
onedrive: require('./storage-onedrive'),
cache: Launcher ? require('./storage-file-cache') : require('./storage-cache')
};
_.forEach(Storage, function(prv) {
prv.init();
});
module.exports = Storage;

View File

@ -29,6 +29,7 @@ _.extend(StorageBase.prototype, {
}
}
this.logger = new Logger('storage-' + this.name);
return this;
},
_xhr: function(config) {

View File

@ -114,4 +114,4 @@ var StorageCache = StorageBase.extend({
}
});
module.exports = StorageCache;
module.exports = new StorageCache();

View File

@ -213,4 +213,4 @@ var StorageDropbox = StorageBase.extend({
}
});
module.exports = StorageDropbox;
module.exports = new StorageDropbox();

View File

@ -39,13 +39,13 @@ var StorageFileCache = StorageBase.extend({
if (err) {
return callback && callback(err);
}
var ts = logger.ts();
var ts = that.logger.ts();
try {
Launcher.writeFile(that.getPath(id), data);
logger.debug('Saved', id, logger.ts(ts));
that.logger.debug('Saved', id, that.logger.ts(ts));
if (callback) { callback(); }
} catch (e) {
logger.error('Error saving to cache', id, e);
that.logger.error('Error saving to cache', id, e);
if (callback) { callback(e); }
}
});
@ -93,4 +93,4 @@ var StorageFileCache = StorageBase.extend({
}
});
module.exports = StorageFileCache;
module.exports = new StorageFileCache();

View File

@ -109,4 +109,4 @@ var StorageFile = StorageBase.extend({
}
});
module.exports = StorageFile;
module.exports = new StorageFile();

View File

@ -62,7 +62,7 @@ var StorageGDrive = StorageBase.extend({
return callback && callback(null, { rev: rev });
},
error: function(err) {
that.logger.error('Stat error', that.logger.ts(ts), resp.result.error);
that.logger.error('Stat error', that.logger.ts(ts), err);
return callback && callback(err);
}
});
@ -213,4 +213,4 @@ var StorageGDrive = StorageBase.extend({
}
});
module.exports = StorageGDrive;
module.exports = new StorageGDrive();

View File

@ -33,4 +33,4 @@ var StorageOneDrive = StorageBase.extend({
}
});
module.exports = StorageOneDrive;
module.exports = new StorageOneDrive();

View File

@ -192,4 +192,4 @@ var StorageWebDav = StorageBase.extend({
}
});
module.exports = StorageWebDav;
module.exports = new StorageWebDav();