Change scann/toss watch msg again, use access() over exists()
This commit is contained in:
parent
2e159a0cc6
commit
21d0ad9e59
|
@ -2778,16 +2778,9 @@ FTNMessageScanTossModule.prototype.startup = function (cb) {
|
||||||
});
|
});
|
||||||
|
|
||||||
const makeImportMsg = (e, path) => {
|
const makeImportMsg = (e, path) => {
|
||||||
const indicator =
|
return `Import/toss due to @watch[${e}] "${paths.basename(
|
||||||
{
|
|
||||||
change: '~',
|
|
||||||
add: '+',
|
|
||||||
delete: '-',
|
|
||||||
exists: '=',
|
|
||||||
}[e] || '';
|
|
||||||
return `Import/toss due to @watch [${indicator}]: ${paths.basename(
|
|
||||||
path
|
path
|
||||||
)}`;
|
)}"`;
|
||||||
};
|
};
|
||||||
|
|
||||||
['change', 'add', 'delete'].forEach(event => {
|
['change', 'add', 'delete'].forEach(event => {
|
||||||
|
@ -2806,8 +2799,9 @@ FTNMessageScanTossModule.prototype.startup = function (cb) {
|
||||||
// If the watch file already exists, kick off now
|
// If the watch file already exists, kick off now
|
||||||
// https://github.com/NuSkooler/enigma-bbs/issues/122
|
// https://github.com/NuSkooler/enigma-bbs/issues/122
|
||||||
//
|
//
|
||||||
fse.exists(importSchedule.watchFile, exists => {
|
fse.access(importSchedule.watchFile, fse.constants.R_OK, err => {
|
||||||
if (exists) {
|
if (!err) {
|
||||||
|
// exists and we can read
|
||||||
tryImportNow(
|
tryImportNow(
|
||||||
makeImportMsg('exists', importSchedule.watchFile),
|
makeImportMsg('exists', importSchedule.watchFile),
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue