Limit schema diagnostics to dev builds
This commit is contained in:
parent
7f92220ef9
commit
164701450c
1 changed files with 30 additions and 28 deletions
|
@ -1519,35 +1519,37 @@ Zotero.Schema = new function(){
|
|||
}
|
||||
|
||||
// TEMP: DB diagnostics
|
||||
let badDB = false;
|
||||
let exists = yield Zotero.DB.tableExists('transactionSets');
|
||||
url += "&ts=" + (exists ? "1" : "0");
|
||||
if (exists) {
|
||||
Zotero.logError("DB table 'transactionSets' still exists");
|
||||
badDB = true;
|
||||
}
|
||||
exists = yield Zotero.DB.tableExists('dbDebug1');
|
||||
url += "&db1=" + (exists ? "1" : "0");
|
||||
if (!exists) {
|
||||
Zotero.logError("DB table 'dbDebug1' does not exist");
|
||||
badDB = true;
|
||||
}
|
||||
if (badDB) {
|
||||
let cloudDir = Zotero.File.isCloudStorageFolder(Zotero.DataDirectory.dir);
|
||||
url += "&cd=" + (cloudDir ? "1" : "0");
|
||||
|
||||
if (!this._debugDBIntegrityChecked) {
|
||||
try {
|
||||
let dbPath = Zotero.DataDirectory.getDatabase();
|
||||
let dbInfo = yield OS.File.stat(dbPath);
|
||||
if (dbInfo.size < 500000000) {
|
||||
let ok = yield Zotero.DB.quickCheck();
|
||||
url += "&qc=" + (ok ? "1" : "0");
|
||||
this._debugDBIntegrityChecked = true;
|
||||
if (Zotero.isDevBuild) {
|
||||
let badDB = false;
|
||||
let exists = yield Zotero.DB.tableExists('transactionSets');
|
||||
url += "&ts=" + (exists ? "1" : "0");
|
||||
if (exists) {
|
||||
Zotero.logError("DB table 'transactionSets' still exists");
|
||||
badDB = true;
|
||||
}
|
||||
exists = yield Zotero.DB.tableExists('dbDebug1');
|
||||
url += "&db1=" + (exists ? "1" : "0");
|
||||
if (!exists) {
|
||||
Zotero.logError("DB table 'dbDebug1' does not exist");
|
||||
badDB = true;
|
||||
}
|
||||
if (badDB) {
|
||||
let cloudDir = Zotero.File.isCloudStorageFolder(Zotero.DataDirectory.dir);
|
||||
url += "&cd=" + (cloudDir ? "1" : "0");
|
||||
|
||||
if (!this._debugDBIntegrityChecked) {
|
||||
try {
|
||||
let dbPath = Zotero.DataDirectory.getDatabase();
|
||||
let dbInfo = yield OS.File.stat(dbPath);
|
||||
if (dbInfo.size < 500000000) {
|
||||
let ok = yield Zotero.DB.quickCheck();
|
||||
url += "&qc=" + (ok ? "1" : "0");
|
||||
this._debugDBIntegrityChecked = true;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue