miolo 2.0.0-beta.2 → 2.0.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * miolo v2.0.0-beta.2
2
+ * miolo v2.0.0-beta.21
3
3
  *
4
4
  * https://www.afialapis.com/os/miolo
5
5
  *
@@ -733,11 +733,11 @@ var base_config = {
733
733
  // {
734
734
  // name,
735
735
  // cronTime,
736
- // onTick(miolo, onComplete),
736
+ // onTick: async (miolo, onComplete),
737
737
  // Notice that if task runs too fast, you may see that
738
738
  // onTick is actually never run, but onComplete is.
739
739
  // Consider passing a higher interval on cronTime
740
- // onComplete(miolo),
740
+ // onComplete: async (miolo),
741
741
  // timezone, context, runOnInit, utcOffset, unrefTimeout
742
742
  // }
743
743
  // check https://github.com/kelektiv/node-cron#readme
@@ -805,6 +805,12 @@ var base_config = {
805
805
  server: 'server/index.jsx'
806
806
  // html: '',
807
807
  // loader: async (ctx) => {}
808
+ },
809
+ dev: {
810
+ watcher: {
811
+ enabled: true
812
+ // dirs: [] By default, server's entry dir
813
+ }
808
814
  }
809
815
  };
810
816
 
@@ -2422,12 +2428,27 @@ function ipsum_config() {
2422
2428
  return {
2423
2429
  name: 'IPsum',
2424
2430
  cronTime: '0 0 * * *',
2425
- onTick: function onTick(miolo, _onCompleted) {
2426
- var folder = miolo.config.http.ratelimit.ipsum_folder || _IPSUM_DEF_FOLDER;
2427
- ipsum_update(folder, function (ips) {
2428
- miolo.logger.debug("[cron][" + cyan('IPsum') + "] File downloaded. " + green(ips.length) + " ips will be " + yellow('blacklisted') + "!");
2429
- }, miolo.logger);
2430
- },
2431
+ onTick: function () {
2432
+ var _onTick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(miolo, _onCompleted) {
2433
+ var folder;
2434
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2435
+ while (1) switch (_context.prev = _context.next) {
2436
+ case 0:
2437
+ folder = miolo.config.http.ratelimit.ipsum_folder || _IPSUM_DEF_FOLDER;
2438
+ ipsum_update(folder, function (ips) {
2439
+ miolo.logger.debug("[cron][" + cyan('IPsum') + "] File downloaded. " + green(ips.length) + " ips will be " + yellow('blacklisted') + "!");
2440
+ }, miolo.logger);
2441
+ case 2:
2442
+ case "end":
2443
+ return _context.stop();
2444
+ }
2445
+ }, _callee);
2446
+ }));
2447
+ function onTick(_x, _x2) {
2448
+ return _onTick.apply(this, arguments);
2449
+ }
2450
+ return onTick;
2451
+ }(),
2431
2452
  start: true
2432
2453
  };
2433
2454
  }
@@ -7555,28 +7576,63 @@ function init_cron_job(miolo, config) {
7555
7576
  var job = new CronJob(
7556
7577
  // cronTime
7557
7578
  (config == null ? void 0 : config.cronTime) || '*/5 * * * *',
7579
+ /*#__PURE__*/
7558
7580
  // onTick(miolo, onComplete)
7559
- function (onComplete) {
7560
- try {
7561
- logger.silly("[cron][Custom Job " + cyan(name) + "] " + green_bold('ticks!'));
7562
- config.onTick(miolo, onComplete);
7563
- } catch (e) {
7564
- logger.error("[cron][Custom Job " + cyan(name) + "] Error at onTick()");
7565
- logger.error(e);
7566
- }
7567
- },
7568
- // onComplete(miolo)
7569
7581
  function () {
7570
- logger.silly("[cron][Custom Job " + cyan(name) + "] " + green_bold('completed!'));
7571
- if (config != null && config.onComplete) {
7572
- try {
7573
- config.onComplete(miolo);
7574
- } catch (e) {
7575
- logger.error("[cron][Custom Job " + cyan(name) + "] Error at onComplete()");
7576
- logger.error(e);
7582
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(onComplete) {
7583
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7584
+ while (1) switch (_context.prev = _context.next) {
7585
+ case 0:
7586
+ _context.prev = 0;
7587
+ logger.silly("[cron][Custom Job " + cyan(name) + "] " + green_bold('ticks!'));
7588
+ _context.next = 4;
7589
+ return config.onTick(miolo, onComplete);
7590
+ case 4:
7591
+ _context.next = 10;
7592
+ break;
7593
+ case 6:
7594
+ _context.prev = 6;
7595
+ _context.t0 = _context["catch"](0);
7596
+ logger.error("[cron][Custom Job " + cyan(name) + "] Error at onTick()");
7597
+ logger.error(_context.t0);
7598
+ case 10:
7599
+ case "end":
7600
+ return _context.stop();
7601
+ }
7602
+ }, _callee, null, [[0, 6]]);
7603
+ }));
7604
+ return function (_x) {
7605
+ return _ref.apply(this, arguments);
7606
+ };
7607
+ }(),
7608
+ /*#__PURE__*/
7609
+ // onComplete(miolo)
7610
+ _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
7611
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
7612
+ while (1) switch (_context2.prev = _context2.next) {
7613
+ case 0:
7614
+ logger.silly("[cron][Custom Job " + cyan(name) + "] " + green_bold('completed!'));
7615
+ if (!(config != null && config.onComplete)) {
7616
+ _context2.next = 11;
7617
+ break;
7618
+ }
7619
+ _context2.prev = 2;
7620
+ _context2.next = 5;
7621
+ return config.onComplete(miolo);
7622
+ case 5:
7623
+ _context2.next = 11;
7624
+ break;
7625
+ case 7:
7626
+ _context2.prev = 7;
7627
+ _context2.t0 = _context2["catch"](2);
7628
+ logger.error("[cron][Custom Job " + cyan(name) + "] Error at onComplete()");
7629
+ logger.error(_context2.t0);
7630
+ case 11:
7631
+ case "end":
7632
+ return _context2.stop();
7577
7633
  }
7578
- }
7579
- },
7634
+ }, _callee2, null, [[2, 7]]);
7635
+ })),
7580
7636
  // Do not start yet
7581
7637
  false, (config == null ? void 0 : config.timezone) || 'Europe/Madrid') // config?.context || null,
7582
7638
  // config?.runOnInit || null,
@@ -7618,9 +7674,23 @@ function sys_check_config() {
7618
7674
  return {
7619
7675
  name: 'SysCheck',
7620
7676
  cronTime: '0,15,30,45 * * * *',
7621
- onTick: function onTick(miolo, _onCompleted) {
7622
- _sys_check_and_log(miolo.logger);
7623
- },
7677
+ onTick: function () {
7678
+ var _onTick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(miolo, _onCompleted) {
7679
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7680
+ while (1) switch (_context.prev = _context.next) {
7681
+ case 0:
7682
+ _sys_check_and_log(miolo.logger);
7683
+ case 1:
7684
+ case "end":
7685
+ return _context.stop();
7686
+ }
7687
+ }, _callee);
7688
+ }));
7689
+ function onTick(_x, _x2) {
7690
+ return _onTick.apply(this, arguments);
7691
+ }
7692
+ return onTick;
7693
+ }(),
7624
7694
  start: true
7625
7695
  };
7626
7696
  }
@@ -7629,9 +7699,24 @@ function sys_email_queue_config() {
7629
7699
  return {
7630
7700
  name: 'Emailer',
7631
7701
  cronTime: '* * * * *',
7632
- onTick: function onTick(miolo, _onCompleted) {
7633
- miolo.emailer.queue_send_emails(miolo.logger);
7634
- },
7702
+ onTick: function () {
7703
+ var _onTick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(miolo, _onCompleted) {
7704
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7705
+ while (1) switch (_context.prev = _context.next) {
7706
+ case 0:
7707
+ _context.next = 2;
7708
+ return miolo.emailer.queue_send_emails(miolo.logger);
7709
+ case 2:
7710
+ case "end":
7711
+ return _context.stop();
7712
+ }
7713
+ }, _callee);
7714
+ }));
7715
+ function onTick(_x, _x2) {
7716
+ return _onTick.apply(this, arguments);
7717
+ }
7718
+ return onTick;
7719
+ }(),
7635
7720
  start: true
7636
7721
  };
7637
7722
  }
@@ -7668,90 +7753,220 @@ function init_cron(app, custom) {
7668
7753
  }
7669
7754
  return jobInfo;
7670
7755
  };
7671
- var _start_job = function _start_job(jobInfo) {
7672
- try {
7673
- jobInfo.job.start();
7674
- jobInfo.isActive = true;
7675
- logger.debug("[cron][Job " + cyan(jobInfo.name) + "] " + green_bold('started!'));
7676
- return 1;
7677
- } catch (e) {
7678
- logger.error("[cron][Job " + cyan(jobInfo.name) + "] Error starting it");
7679
- logger.error(e);
7680
- return 0;
7681
- }
7682
- };
7683
- var _start_job_by_idx_or_name = function _start_job_by_idx_or_name(idxOrName) {
7684
- var jobInfo = _find_job_by_idx_or_name(idxOrName);
7685
- if (jobInfo) {
7686
- var done = _start_job(jobInfo);
7687
- return [done, jobInfo.name];
7688
- }
7689
- return [0, ''];
7690
- };
7691
- var _start_all_jobs = function _start_all_jobs() {
7692
- try {
7693
- var started = [],
7694
- errors = [];
7695
- jobInfos.map(function (jobInfo) {
7696
- var done = _start_job(jobInfo);
7697
- if (done == 1) {
7698
- started.push(jobInfo.name);
7699
- } else {
7700
- errors.push(jobInfo.name);
7756
+ var _start_job = /*#__PURE__*/function () {
7757
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(jobInfo) {
7758
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7759
+ while (1) switch (_context.prev = _context.next) {
7760
+ case 0:
7761
+ _context.prev = 0;
7762
+ _context.next = 3;
7763
+ return jobInfo.job.start();
7764
+ case 3:
7765
+ jobInfo.isActive = true;
7766
+ logger.debug("[cron][Job " + cyan(jobInfo.name) + "] " + green_bold('started!'));
7767
+ return _context.abrupt("return", 1);
7768
+ case 8:
7769
+ _context.prev = 8;
7770
+ _context.t0 = _context["catch"](0);
7771
+ logger.error("[cron][Job " + cyan(jobInfo.name) + "] Error starting it");
7772
+ logger.error(_context.t0);
7773
+ return _context.abrupt("return", 0);
7774
+ case 13:
7775
+ case "end":
7776
+ return _context.stop();
7701
7777
  }
7702
- });
7703
- if (started.length > 0) {
7704
- logger.info("[cron] Started " + started.length + " jobs: " + started);
7705
- }
7706
- if (errors.length > 0) {
7707
- logger.warn("[cron] Could not start " + errors.length + " jobs: " + errors);
7708
- }
7709
- } catch (error) {
7710
- logger.error("[cron] start() error: " + error);
7711
- }
7712
- };
7713
- var _stop_job = function _stop_job(jobInfo) {
7714
- try {
7715
- jobInfo.job.stop();
7716
- jobInfo.isActive = false;
7717
- logger.debug("[cron][Job " + cyan(jobInfo.name) + "] " + yellow_bold('stopped!'));
7718
- return 1;
7719
- } catch (e) {
7720
- logger.error("[cron][Job " + cyan(jobInfo.name) + "] Error stopping it");
7721
- logger.error(e);
7722
- return 0;
7723
- }
7724
- };
7725
- var _stop_job_by_idx_or_name = function _stop_job_by_idx_or_name(idxOrName) {
7726
- var jobInfo = _find_job_by_idx_or_name(idxOrName);
7727
- if (jobInfo) {
7728
- var done = _stop_job(jobInfo);
7729
- return [done, jobInfo.name];
7730
- }
7731
- return [0, ''];
7732
- };
7733
- var _stop_all_jobs = function _stop_all_jobs() {
7734
- try {
7735
- var stopped = [],
7736
- errors = [];
7737
- jobInfos.map(function (jobInfo) {
7738
- var done = _stop_job(jobInfo);
7739
- if (done == 1) {
7740
- stopped.push(jobInfo.name);
7741
- } else {
7742
- errors.push(jobInfo.name);
7778
+ }, _callee, null, [[0, 8]]);
7779
+ }));
7780
+ return function _start_job(_x) {
7781
+ return _ref.apply(this, arguments);
7782
+ };
7783
+ }();
7784
+ var _start_job_by_idx_or_name = /*#__PURE__*/function () {
7785
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(idxOrName) {
7786
+ var jobInfo, done;
7787
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
7788
+ while (1) switch (_context2.prev = _context2.next) {
7789
+ case 0:
7790
+ jobInfo = _find_job_by_idx_or_name(idxOrName);
7791
+ if (!jobInfo) {
7792
+ _context2.next = 6;
7793
+ break;
7794
+ }
7795
+ _context2.next = 4;
7796
+ return _start_job(jobInfo);
7797
+ case 4:
7798
+ done = _context2.sent;
7799
+ return _context2.abrupt("return", [done, jobInfo.name]);
7800
+ case 6:
7801
+ return _context2.abrupt("return", [0, '']);
7802
+ case 7:
7803
+ case "end":
7804
+ return _context2.stop();
7743
7805
  }
7744
- });
7745
- if (stopped.length > 0) {
7746
- logger.info("[cron] Stopped " + stopped.length + " jobs: " + stopped);
7747
- }
7748
- if (errors.length > 0) {
7749
- logger.warn("[cron] Could not stop " + errors.length + " jobs: " + errors);
7750
- }
7751
- } catch (error) {
7752
- logger.error("[cron] stop() error: " + error);
7753
- }
7754
- };
7806
+ }, _callee2);
7807
+ }));
7808
+ return function _start_job_by_idx_or_name(_x2) {
7809
+ return _ref2.apply(this, arguments);
7810
+ };
7811
+ }();
7812
+ var _start_all_jobs = /*#__PURE__*/function () {
7813
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
7814
+ var started, errors, _i, _jobInfos, jobInfo, done;
7815
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
7816
+ while (1) switch (_context3.prev = _context3.next) {
7817
+ case 0:
7818
+ _context3.prev = 0;
7819
+ started = [], errors = [];
7820
+ _i = 0, _jobInfos = jobInfos;
7821
+ case 3:
7822
+ if (!(_i < _jobInfos.length)) {
7823
+ _context3.next = 12;
7824
+ break;
7825
+ }
7826
+ jobInfo = _jobInfos[_i];
7827
+ _context3.next = 7;
7828
+ return _start_job(jobInfo);
7829
+ case 7:
7830
+ done = _context3.sent;
7831
+ if (done == 1) {
7832
+ started.push(jobInfo.name);
7833
+ } else {
7834
+ errors.push(jobInfo.name);
7835
+ }
7836
+ case 9:
7837
+ _i++;
7838
+ _context3.next = 3;
7839
+ break;
7840
+ case 12:
7841
+ if (started.length > 0) {
7842
+ logger.info("[cron] Started " + started.length + " jobs: " + started);
7843
+ }
7844
+ if (errors.length > 0) {
7845
+ logger.warn("[cron] Could not start " + errors.length + " jobs: " + errors);
7846
+ }
7847
+ _context3.next = 19;
7848
+ break;
7849
+ case 16:
7850
+ _context3.prev = 16;
7851
+ _context3.t0 = _context3["catch"](0);
7852
+ logger.error("[cron] start() error: " + _context3.t0);
7853
+ case 19:
7854
+ case "end":
7855
+ return _context3.stop();
7856
+ }
7857
+ }, _callee3, null, [[0, 16]]);
7858
+ }));
7859
+ return function _start_all_jobs() {
7860
+ return _ref3.apply(this, arguments);
7861
+ };
7862
+ }();
7863
+ var _stop_job = /*#__PURE__*/function () {
7864
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(jobInfo) {
7865
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
7866
+ while (1) switch (_context4.prev = _context4.next) {
7867
+ case 0:
7868
+ _context4.prev = 0;
7869
+ _context4.next = 3;
7870
+ return jobInfo.job.stop();
7871
+ case 3:
7872
+ jobInfo.isActive = false;
7873
+ logger.debug("[cron][Job " + cyan(jobInfo.name) + "] " + yellow_bold('stopped!'));
7874
+ return _context4.abrupt("return", 1);
7875
+ case 8:
7876
+ _context4.prev = 8;
7877
+ _context4.t0 = _context4["catch"](0);
7878
+ logger.error("[cron][Job " + cyan(jobInfo.name) + "] Error stopping it");
7879
+ logger.error(_context4.t0);
7880
+ return _context4.abrupt("return", 0);
7881
+ case 13:
7882
+ case "end":
7883
+ return _context4.stop();
7884
+ }
7885
+ }, _callee4, null, [[0, 8]]);
7886
+ }));
7887
+ return function _stop_job(_x3) {
7888
+ return _ref4.apply(this, arguments);
7889
+ };
7890
+ }();
7891
+ var _stop_job_by_idx_or_name = /*#__PURE__*/function () {
7892
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(idxOrName) {
7893
+ var jobInfo, done;
7894
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
7895
+ while (1) switch (_context5.prev = _context5.next) {
7896
+ case 0:
7897
+ jobInfo = _find_job_by_idx_or_name(idxOrName);
7898
+ if (!jobInfo) {
7899
+ _context5.next = 6;
7900
+ break;
7901
+ }
7902
+ _context5.next = 4;
7903
+ return _stop_job(jobInfo);
7904
+ case 4:
7905
+ done = _context5.sent;
7906
+ return _context5.abrupt("return", [done, jobInfo.name]);
7907
+ case 6:
7908
+ return _context5.abrupt("return", [0, '']);
7909
+ case 7:
7910
+ case "end":
7911
+ return _context5.stop();
7912
+ }
7913
+ }, _callee5);
7914
+ }));
7915
+ return function _stop_job_by_idx_or_name(_x4) {
7916
+ return _ref5.apply(this, arguments);
7917
+ };
7918
+ }();
7919
+ var _stop_all_jobs = /*#__PURE__*/function () {
7920
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
7921
+ var stopped, errors, _i2, _jobInfos2, jobInfo, done;
7922
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
7923
+ while (1) switch (_context6.prev = _context6.next) {
7924
+ case 0:
7925
+ _context6.prev = 0;
7926
+ stopped = [], errors = [];
7927
+ _i2 = 0, _jobInfos2 = jobInfos;
7928
+ case 3:
7929
+ if (!(_i2 < _jobInfos2.length)) {
7930
+ _context6.next = 12;
7931
+ break;
7932
+ }
7933
+ jobInfo = _jobInfos2[_i2];
7934
+ _context6.next = 7;
7935
+ return _stop_job(jobInfo);
7936
+ case 7:
7937
+ done = _context6.sent;
7938
+ if (done == 1) {
7939
+ stopped.push(jobInfo.name);
7940
+ } else {
7941
+ errors.push(jobInfo.name);
7942
+ }
7943
+ case 9:
7944
+ _i2++;
7945
+ _context6.next = 3;
7946
+ break;
7947
+ case 12:
7948
+ if (stopped.length > 0) {
7949
+ logger.info("[cron] Stopped " + stopped.length + " jobs: " + stopped);
7950
+ }
7951
+ if (errors.length > 0) {
7952
+ logger.warn("[cron] Could not stop " + errors.length + " jobs: " + errors);
7953
+ }
7954
+ _context6.next = 19;
7955
+ break;
7956
+ case 16:
7957
+ _context6.prev = 16;
7958
+ _context6.t0 = _context6["catch"](0);
7959
+ logger.error("[cron] stop() error: " + _context6.t0);
7960
+ case 19:
7961
+ case "end":
7962
+ return _context6.stop();
7963
+ }
7964
+ }, _callee6, null, [[0, 16]]);
7965
+ }));
7966
+ return function _stop_all_jobs() {
7967
+ return _ref6.apply(this, arguments);
7968
+ };
7969
+ }();
7755
7970
  app.cron = {
7756
7971
  jobs: jobInfos,
7757
7972
  start_one: _start_job_by_idx_or_name,
@@ -7982,8 +8197,9 @@ function _miolo() {
7982
8197
  _context.next = 4;
7983
8198
  return app.http.start();
7984
8199
  case 4:
7985
- app.cron.start();
7986
- case 5:
8200
+ _context.next = 6;
8201
+ return app.cron.start();
8202
+ case 6:
7987
8203
  case "end":
7988
8204
  return _context.stop();
7989
8205
  }
@@ -7993,12 +8209,19 @@ function _miolo() {
7993
8209
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
7994
8210
  while (1) switch (_context2.prev = _context2.next) {
7995
8211
  case 0:
7996
- app.context.miolo.db.drop_connections();
7997
- _context2.next = 3;
8212
+ _context2.next = 2;
8213
+ return app.context.miolo.db.drop_connections();
8214
+ case 2:
8215
+ _context2.next = 4;
7998
8216
  return app.http.stop();
7999
- case 3:
8000
- app.cron.stop();
8001
8217
  case 4:
8218
+ _context2.next = 6;
8219
+ return app.cron.stop();
8220
+ case 6:
8221
+ if (app != null && app.vite) {
8222
+ app.vite.close();
8223
+ }
8224
+ case 7:
8002
8225
  case "end":
8003
8226
  return _context2.stop();
8004
8227
  }
@@ -8032,4 +8255,79 @@ function _miolo() {
8032
8255
  return _miolo.apply(this, arguments);
8033
8256
  }
8034
8257
 
8035
- export { miolo, init_emailer_transporter as miolo_emailer, init_logger as miolo_logger, init_parser as miolo_parser };
8258
+ function miolo_cron(_x) {
8259
+ return _miolo_cron.apply(this, arguments);
8260
+ }
8261
+ function _miolo_cron() {
8262
+ _miolo_cron = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sconfig) {
8263
+ var app, config;
8264
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
8265
+ while (1) switch (_context4.prev = _context4.next) {
8266
+ case 0:
8267
+ app = {
8268
+ use: function use() {},
8269
+ context: {}
8270
+ }; // Init some pieces
8271
+ config = init_config(sconfig); // attach to app some custom miolo methods
8272
+ init_context_middleware(app, config);
8273
+
8274
+ // Init cron (will not start jobs yet)
8275
+ init_cron(app, config == null ? void 0 : config.cron);
8276
+
8277
+ // Util callbacks
8278
+ app.start = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8279
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8280
+ while (1) switch (_context.prev = _context.next) {
8281
+ case 0:
8282
+ _context.next = 2;
8283
+ return app.context.miolo.db.init_connection();
8284
+ case 2:
8285
+ _context.next = 4;
8286
+ return app.cron.start();
8287
+ case 4:
8288
+ case "end":
8289
+ return _context.stop();
8290
+ }
8291
+ }, _callee);
8292
+ }));
8293
+ app.stop = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
8294
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8295
+ while (1) switch (_context2.prev = _context2.next) {
8296
+ case 0:
8297
+ _context2.next = 2;
8298
+ return app.context.miolo.db.drop_connections();
8299
+ case 2:
8300
+ _context2.next = 4;
8301
+ return app.cron.stop();
8302
+ case 4:
8303
+ case "end":
8304
+ return _context2.stop();
8305
+ }
8306
+ }, _callee2);
8307
+ }));
8308
+ app.restart = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
8309
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8310
+ while (1) switch (_context3.prev = _context3.next) {
8311
+ case 0:
8312
+ _context3.next = 2;
8313
+ return app.stop();
8314
+ case 2:
8315
+ _context3.next = 4;
8316
+ return app.start();
8317
+ case 4:
8318
+ case "end":
8319
+ return _context3.stop();
8320
+ }
8321
+ }, _callee3);
8322
+ }));
8323
+ return _context4.abrupt("return", app);
8324
+ case 8:
8325
+ case "end":
8326
+ return _context4.stop();
8327
+ }
8328
+ }, _callee4);
8329
+ }));
8330
+ return _miolo_cron.apply(this, arguments);
8331
+ }
8332
+
8333
+ export { miolo, miolo_cron, init_emailer_transporter as miolo_emailer, init_logger as miolo_logger, init_parser as miolo_parser };