Skip to content

Commit

Permalink
Merge pull request meteor#9644 from brucejo75/WSL_SQLITE_TRUNCATE
Browse files Browse the repository at this point in the history
TRUNCATE journal mode for packaging DB on Windows like file systems
  • Loading branch information
abernix authored Feb 7, 2018
2 parents 9650679 + e34c72f commit 52fb454
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/packaging/catalog/catalog-remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,16 @@ var Db = function (dbFile, options) {
});

// WAL mode copes much better with (multi-process) concurrency
// Windows Subsystem for Linux cannot work with WAL mode
// https://github.com/meteor/meteor-feature-requests/issues/154
// So if any of the filesystems are a windows filesystem (e.g. WSL)
// Then we will run with TRUNCATE mode.
self._retry(function () {
self._execute('PRAGMA journal_mode=WAL');
if(files.isWindowsLikeFilesystem()) {
self._execute('PRAGMA journal_mode=TRUNCATE');
} else {
self._execute('PRAGMA journal_mode=WAL');
}
});
};

Expand Down

0 comments on commit 52fb454

Please sign in to comment.