manu-sapiens commited on
Commit
df92ffb
·
1 Parent(s): 8cc5a5a

switching to verbose to find the bug

Browse files
Files changed (2) hide show
  1. hf_server.js +42 -43
  2. omnitool_init.sh +1 -1
hf_server.js CHANGED
@@ -3,7 +3,7 @@
3
  * All rights reserved.
4
  */
5
  //@ts-check
6
- const VERSION = '0.6.0.hf.014.f';
7
 
8
  const express = require('express');
9
  const http = require('http');
@@ -452,48 +452,6 @@ function omnitoolProxyMiddleware(req, res, next)
452
  }
453
  }
454
 
455
- function startMirrorToDataDir()
456
- {
457
- if (!fs.existsSync(targetDir)) return;
458
-
459
- const watcher = chokidar.watch(sourceDir, {
460
- ignored: /[\/\\]\./,
461
- persistent: true
462
- });
463
-
464
- watcher
465
- .on('add', function(path) {
466
- const targetFile = path.replace(sourceDir, targetDir);
467
- console.log(`TargetFile = ${targetFile}. File ${path} would have been added and copied from ${sourceDir} to ${targetDir}`);
468
- /*
469
- fs.copyFile(path, targetFile, (err) => {
470
- if (err) throw err;
471
- console.log('File', path, 'has been added and copied to', targetFile);
472
- });*/
473
- })
474
- .on('change', function(path) {
475
- const targetFile = path.replace(sourceDir, targetDir);
476
- console.log(`TargetFile = ${targetFile}. File ${path} would have been changed and copied from ${sourceDir} to ${targetDir}`);
477
- /*
478
- fs.copyFile(path, targetFile, (err) => {
479
- if (err) throw err;
480
- console.log('File', path, 'has been changed and copied to', targetFile);
481
- });
482
- */
483
- })
484
- .on('unlink', function(path) {
485
- const targetFile = path.replace(sourceDir, targetDir);
486
- console.log(`TargetFile = ${targetFile}. File ${path} would have been removed from ${targetDir}`);
487
- /*
488
- fs.unlink(targetFile, (err) => {
489
- if (err) throw err;
490
- console.log('File', path, 'has been removed');
491
- });*/
492
- });
493
-
494
- return watcher;
495
- }
496
-
497
  async function main(app)
498
  {
499
  if (fs.existsSync(targetDir)) {
@@ -558,3 +516,44 @@ main(app);
558
 
559
 
560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * All rights reserved.
4
  */
5
  //@ts-check
6
+ const VERSION = '0.6.0.hf.014.g';
7
 
8
  const express = require('express');
9
  const http = require('http');
 
452
  }
453
  }
454
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  async function main(app)
456
  {
457
  if (fs.existsSync(targetDir)) {
 
516
 
517
 
518
 
519
+ function startMirrorToDataDir()
520
+ {
521
+ if (!fs.existsSync(targetDir)) return;
522
+
523
+ const watcher = chokidar.watch(sourceDir, {
524
+ ignored: /[\/\\]\./,
525
+ persistent: true
526
+ });
527
+
528
+ watcher
529
+ .on('add', function(path) {
530
+ const targetFile = path.replace(sourceDir, targetDir);
531
+ console.warn(`TargetFile = ${targetFile}. File ${path} would have been added and copied from ${sourceDir} to ${targetDir}`);
532
+ /*
533
+ fs.copyFile(path, targetFile, (err) => {
534
+ if (err) throw err;
535
+ console.log('File', path, 'has been added and copied to', targetFile);
536
+ });*/
537
+ })
538
+ .on('change', function(path) {
539
+ const targetFile = path.replace(sourceDir, targetDir);
540
+ console.warn(`TargetFile = ${targetFile}. File ${path} would have been changed and copied from ${sourceDir} to ${targetDir}`);
541
+ /*
542
+ fs.copyFile(path, targetFile, (err) => {
543
+ if (err) throw err;
544
+ console.log('File', path, 'has been changed and copied to', targetFile);
545
+ });
546
+ */
547
+ })
548
+ .on('unlink', function(path) {
549
+ const targetFile = path.replace(sourceDir, targetDir);
550
+ console.warn(`TargetFile = ${targetFile}. File ${path} would have been removed from ${targetDir}`);
551
+ /*
552
+ fs.unlink(targetFile, (err) => {
553
+ if (err) throw err;
554
+ console.log('File', path, 'has been removed');
555
+ });*/
556
+ });
557
+
558
+ return watcher;
559
+ }
omnitool_init.sh CHANGED
@@ -41,4 +41,4 @@ else
41
  fi
42
 
43
  echo "[->] YARN START "
44
- yarn start -u -rb -R blocks
 
41
  fi
42
 
43
  echo "[->] YARN START "
44
+ yarn start -u -rb --verbose -R blocks