mirror of https://github.com/calzoneman/sync.git
Fix an issue where one broken channel can prevent others from saving
Son of a bitch.
This commit is contained in:
parent
b0daa58874
commit
31880fa625
|
@ -2,7 +2,7 @@
|
|||
"author": "Calvin Montgomery",
|
||||
"name": "CyTube",
|
||||
"description": "Online media synchronizer and chat",
|
||||
"version": "3.25.2",
|
||||
"version": "3.26.0",
|
||||
"repository": {
|
||||
"url": "http://github.com/calzoneman/sync"
|
||||
},
|
||||
|
|
|
@ -77,10 +77,11 @@ export class DatabaseStore {
|
|||
}
|
||||
|
||||
if (totalSize > SIZE_LIMIT) {
|
||||
throw new ChannelStateSizeError('Channel state size is too large', {
|
||||
return Promise.reject(new ChannelStateSizeError(
|
||||
'Channel state size is too large', {
|
||||
limit: SIZE_LIMIT,
|
||||
actual: totalSize
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
return queryAsync(buildUpdateQuery(rowCount), substitutions);
|
||||
|
|
|
@ -20,10 +20,11 @@ export class FileStore {
|
|||
const filename = this.filenameForChannel(channelName);
|
||||
return statAsync(filename).then(stats => {
|
||||
if (stats.size > SIZE_LIMIT) {
|
||||
throw new ChannelStateSizeError('Channel state file is too large', {
|
||||
return Promise.reject(
|
||||
new ChannelStateSizeError('Channel state file is too large', {
|
||||
limit: SIZE_LIMIT,
|
||||
actual: stats.size
|
||||
});
|
||||
}));
|
||||
} else {
|
||||
return readFileAsync(filename);
|
||||
}
|
||||
|
@ -31,7 +32,7 @@ export class FileStore {
|
|||
try {
|
||||
return JSON.parse(fileContents);
|
||||
} catch (e) {
|
||||
throw new Error('Channel state file is not valid JSON: ' + e);
|
||||
return Promise.reject(new Error('Channel state file is not valid JSON: ' + e));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue