Further improvements in caching. The state of the cache is now persisted in DB. This persists the cache between server restarts.
This commit is contained in:
parent
7bcd6c60e9
commit
ef0464bbc9
8 changed files with 155 additions and 75 deletions
|
@ -50,13 +50,18 @@ function getConfigROUidGid() {
|
|||
|
||||
function ensureMailtrainOwner(file, callback) {
|
||||
const ids = getConfigUidGid();
|
||||
fs.chown(file, ids.uid, ids.gid, callback);
|
||||
|
||||
if (callback) {
|
||||
fs.chown(file, ids.uid, ids.gid, callback);
|
||||
} else {
|
||||
return fs.chownAsync(file, ids.uid, ids.gid);
|
||||
}
|
||||
}
|
||||
|
||||
async function ensureMailtrainDir(dir, recursive) {
|
||||
async function ensureMailtrainDir(dir) {
|
||||
const ids = getConfigUidGid();
|
||||
await fs.ensureDir(dir);
|
||||
await fs.chownAsync(dir, ids.uid, ids.gid);
|
||||
await ensureMailtrainOwner(dir);
|
||||
}
|
||||
|
||||
function dropRootPrivileges() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue