Spaces:
Running
Running
Commit
·
8dafc90
1
Parent(s):
dab5564
removed -journal from mirroring. Added /n to mirror errors logs
Browse files- hf_server.js +7 -4
hf_server.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* All rights reserved.
|
4 |
*/
|
5 |
//@ts-check
|
6 |
-
const VERSION = '0.6.0.hf.014.
|
7 |
|
8 |
const express = require('express');
|
9 |
const http = require('http');
|
@@ -537,6 +537,7 @@ function startMirrorToDataDir()
|
|
537 |
watcher
|
538 |
.on('add', function(file_path) {
|
539 |
//if (file_path.includes('-journal') || file_path.includes('httpd.db')) return;
|
|
|
540 |
|
541 |
const targetFile = file_path.replace(sourceDir, targetDir);
|
542 |
//console.warn(`TargetFile = ${targetFile}. File ${file_path} added and copied from ${sourceDir} to ${targetDir}`);
|
@@ -546,7 +547,7 @@ function startMirrorToDataDir()
|
|
546 |
if (err)
|
547 |
{
|
548 |
//throw err;
|
549 |
-
const error_message = `ERROR when doing: File ${file_path} added -> copied to ${targetFile}`;
|
550 |
console.log(error_message);
|
551 |
global.logs.push(error_message);
|
552 |
}});
|
@@ -558,6 +559,7 @@ function startMirrorToDataDir()
|
|
558 |
})
|
559 |
.on('change', function(file_path) {
|
560 |
//if (file_path.includes('-journal') || file_path.includes('httpd.db')) return;
|
|
|
561 |
|
562 |
const targetFile = file_path.replace(sourceDir, targetDir);
|
563 |
//console.warn(`TargetFile = ${targetFile}. File ${file_path} changed and copied from ${sourceDir} to ${targetDir}`);
|
@@ -567,7 +569,7 @@ function startMirrorToDataDir()
|
|
567 |
if (err)
|
568 |
{
|
569 |
//throw err;
|
570 |
-
const error_message = `ERROR when doing: File ${file_path} changed -> copied to ${targetFile}`;
|
571 |
console.log(error_message);
|
572 |
global.logs.push(error_message);
|
573 |
}
|
@@ -581,6 +583,7 @@ function startMirrorToDataDir()
|
|
581 |
})
|
582 |
.on('unlink', function(file_path) {
|
583 |
//if (file_path.includes('-journal') || file_path.includes('httpd.db')) return;
|
|
|
584 |
|
585 |
const targetFile = file_path.replace(sourceDir, targetDir);
|
586 |
//console.warn(`TargetFile = ${targetFile}. File ${file_path} removed from ${targetDir}`);
|
@@ -591,7 +594,7 @@ function startMirrorToDataDir()
|
|
591 |
if (err)
|
592 |
{
|
593 |
// throw err;
|
594 |
-
const error_message = `ERROR when doing: File ${file_path} has been removed from ${targetDir}`;
|
595 |
console.log(error_message);
|
596 |
global.logs.push(error_message);
|
597 |
}
|
|
|
3 |
* All rights reserved.
|
4 |
*/
|
5 |
//@ts-check
|
6 |
+
const VERSION = '0.6.0.hf.014.n';
|
7 |
|
8 |
const express = require('express');
|
9 |
const http = require('http');
|
|
|
537 |
watcher
|
538 |
.on('add', function(file_path) {
|
539 |
//if (file_path.includes('-journal') || file_path.includes('httpd.db')) return;
|
540 |
+
if (file_path.includes('-journal')) return;
|
541 |
|
542 |
const targetFile = file_path.replace(sourceDir, targetDir);
|
543 |
//console.warn(`TargetFile = ${targetFile}. File ${file_path} added and copied from ${sourceDir} to ${targetDir}`);
|
|
|
547 |
if (err)
|
548 |
{
|
549 |
//throw err;
|
550 |
+
const error_message = `ERROR when doing: File ${file_path} added -> copied to ${targetFile}\n`;
|
551 |
console.log(error_message);
|
552 |
global.logs.push(error_message);
|
553 |
}});
|
|
|
559 |
})
|
560 |
.on('change', function(file_path) {
|
561 |
//if (file_path.includes('-journal') || file_path.includes('httpd.db')) return;
|
562 |
+
if (file_path.includes('-journal')) return;
|
563 |
|
564 |
const targetFile = file_path.replace(sourceDir, targetDir);
|
565 |
//console.warn(`TargetFile = ${targetFile}. File ${file_path} changed and copied from ${sourceDir} to ${targetDir}`);
|
|
|
569 |
if (err)
|
570 |
{
|
571 |
//throw err;
|
572 |
+
const error_message = `ERROR when doing: File ${file_path} changed -> copied to ${targetFile}\n`;
|
573 |
console.log(error_message);
|
574 |
global.logs.push(error_message);
|
575 |
}
|
|
|
583 |
})
|
584 |
.on('unlink', function(file_path) {
|
585 |
//if (file_path.includes('-journal') || file_path.includes('httpd.db')) return;
|
586 |
+
if (file_path.includes('-journal')) return;
|
587 |
|
588 |
const targetFile = file_path.replace(sourceDir, targetDir);
|
589 |
//console.warn(`TargetFile = ${targetFile}. File ${file_path} removed from ${targetDir}`);
|
|
|
594 |
if (err)
|
595 |
{
|
596 |
// throw err;
|
597 |
+
const error_message = `ERROR when doing: File ${file_path} has been removed from ${targetDir}\n`;
|
598 |
console.log(error_message);
|
599 |
global.logs.push(error_message);
|
600 |
}
|