@instadapp/interop-x 0.0.0-dev.4349539 → 0.0.0-dev.43cb9e6
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.
- package/dist/package.json +2 -2
- package/dist/src/config/index.js +1 -10
- package/dist/src/index.js +5 -28
- package/dist/src/tasks/AutoUpdateTask.js +11 -33
- package/dist/src/tasks/BaseTask.js +0 -4
- package/package.json +2 -2
- package/src/config/index.ts +1 -9
- package/src/index.ts +9 -41
- package/src/tasks/AutoUpdateTask.ts +14 -36
- package/src/tasks/BaseTask.ts +0 -5
package/dist/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@instadapp/interop-x",
|
3
|
-
"version": "0.0.0-dev.
|
3
|
+
"version": "0.0.0-dev.43cb9e6",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"engines": {
|
@@ -28,6 +28,7 @@
|
|
28
28
|
"await-spawn": "^4.0.2",
|
29
29
|
"axios": "^0.27.1",
|
30
30
|
"axios-retry": "^3.2.4",
|
31
|
+
"bignumber.js": "^9.0.2",
|
31
32
|
"chalk": "4.1.2",
|
32
33
|
"dotenv": "^16.0.0",
|
33
34
|
"ethereumjs-util": "^7.1.4",
|
@@ -35,7 +36,6 @@
|
|
35
36
|
"ethers-multisend": "^2.1.1",
|
36
37
|
"expand-home-dir": "^0.0.3",
|
37
38
|
"fastify": "^3.28.0",
|
38
|
-
"fs-extra": "^10.1.0",
|
39
39
|
"libp2p": "^0.36.2",
|
40
40
|
"libp2p-bootstrap": "^0.14.0",
|
41
41
|
"libp2p-kad-dht": "^0.28.6",
|
package/dist/src/config/index.js
CHANGED
@@ -1,22 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
3
|
const ethers_1 = require("ethers");
|
7
4
|
const types_1 = require("@/types");
|
8
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
9
|
-
const expand_home_dir_1 = __importDefault(require("expand-home-dir"));
|
10
5
|
class Config {
|
11
6
|
constructor() {
|
12
7
|
this.events = new types_1.EventBus();
|
13
|
-
this.maxPeers =
|
8
|
+
this.maxPeers = 10;
|
14
9
|
this.privateKey = process.env.PRIVATE_KEY;
|
15
10
|
this.staging = !!process.env.STAGING && process.env.STAGING === 'true';
|
16
11
|
this.autoUpdate = !!process.env.AUTO_UPDATE && process.env.AUTO_UPDATE === 'true';
|
17
12
|
this.wallet = new ethers_1.Wallet(this.privateKey);
|
18
13
|
this.leadNodeAddress = '0x910E413DBF3F6276Fe8213fF656726bDc142E08E';
|
19
|
-
this.baseConfigPath = (0, expand_home_dir_1.default)(`~/.interop-x`);
|
20
14
|
}
|
21
15
|
get publicAddress() {
|
22
16
|
return this.wallet.address;
|
@@ -24,8 +18,5 @@ class Config {
|
|
24
18
|
isLeadNode() {
|
25
19
|
return ethers_1.ethers.utils.getAddress(this.leadNodeAddress) === ethers_1.ethers.utils.getAddress(this.wallet.address);
|
26
20
|
}
|
27
|
-
isMaintenanceMode() {
|
28
|
-
return fs_extra_1.default.existsSync(this.baseConfigPath + '/maintenance');
|
29
|
-
}
|
30
21
|
}
|
31
22
|
exports.default = new Config();
|
package/dist/src/index.js
CHANGED
@@ -4,8 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const module_alias_1 = __importDefault(require("module-alias"));
|
7
|
-
const expand_home_dir_1 = __importDefault(require("expand-home-dir"));
|
8
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
9
7
|
module_alias_1.default.addAliases({
|
10
8
|
"@/": __dirname + "/",
|
11
9
|
"@/logger": __dirname + "/logger",
|
@@ -28,39 +26,18 @@ const package_json_1 = __importDefault(require("../package.json"));
|
|
28
26
|
dotenv_1.default.config();
|
29
27
|
const logger_1 = __importDefault(require("@/logger"));
|
30
28
|
const logger = new logger_1.default('Process');
|
31
|
-
const GIT_SHORT_HASH = '4349539';
|
32
29
|
const printUsage = () => {
|
33
|
-
console.log();
|
34
|
-
console.log(`Interop X Node (v${package_json_1.default.version} - rev.${GIT_SHORT_HASH})`);
|
35
|
-
console.log();
|
36
30
|
console.log('Usage:');
|
37
|
-
console.log(' interop-x
|
38
|
-
console.log(' interop-x
|
39
|
-
console.log();
|
40
|
-
console.log(' interop-x
|
41
|
-
console.log(' interop-x up Take the node out of maintenance mode');
|
42
|
-
console.log();
|
43
|
-
console.log(' PRIVATE_KEY=abcd1234 interop-x start Start the node with the given private key');
|
44
|
-
console.log(' PRIVATE_KEY=abcd1234 STAGING=true interop-x Start the node in staging mode');
|
45
|
-
console.log(' PRIVATE_KEY=abcd1234 AUTO_UPDATE=true interop-x Start the node in auto update mode');
|
46
|
-
console.log(' PRIVATE_KEY=abcd1234 API_HOST=0.0.0.0 API_PORT=8080 interop-x Start the node with custom API host and port');
|
47
|
-
console.log();
|
31
|
+
console.log(' PRIVATE_KEY=abcd1234 interop-x');
|
32
|
+
console.log(' PRIVATE_KEY=abcd1234 STAGING=true interop-x');
|
33
|
+
console.log(' PRIVATE_KEY=abcd1234 AUTO_UPDATE=true interop-x');
|
34
|
+
console.log(' PRIVATE_KEY=abcd1234 API_HOST=0.0.0.0 API_PORT=8080 interop-x');
|
48
35
|
};
|
49
36
|
if (process.argv.at(-1) === 'help') {
|
50
37
|
printUsage();
|
51
38
|
process.exit(0);
|
52
39
|
}
|
53
|
-
const
|
54
|
-
if (process.argv.at(-1) === 'down') {
|
55
|
-
fs_extra_1.default.outputFileSync(basePath + '/maintenance', Date.now().toString());
|
56
|
-
console.log(chalk_1.default.red('Maintenance mode enabled'));
|
57
|
-
process.exit(0);
|
58
|
-
}
|
59
|
-
if (process.argv.at(-1) === 'up') {
|
60
|
-
fs_extra_1.default.removeSync(basePath + '/maintenance');
|
61
|
-
console.log(chalk_1.default.green('Maintenance mode disabled'));
|
62
|
-
process.exit(0);
|
63
|
-
}
|
40
|
+
const GIT_SHORT_HASH = '43cb9e6';
|
64
41
|
if (process.argv.at(-1) === 'version') {
|
65
42
|
console.log(`Interop X Node (v${package_json_1.default.version} - rev.${GIT_SHORT_HASH})`);
|
66
43
|
process.exit(0);
|
@@ -5,65 +5,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const BaseTask_1 = require("./BaseTask");
|
7
7
|
const logger_1 = __importDefault(require("@/logger"));
|
8
|
+
const utils_1 = require("@/utils");
|
8
9
|
const await_spawn_1 = __importDefault(require("await-spawn"));
|
9
|
-
const child_process_1 = require("child_process");
|
10
10
|
const config_1 = __importDefault(require("@/config"));
|
11
11
|
const waait_1 = __importDefault(require("waait"));
|
12
|
-
const package_json_1 = __importDefault(require("../../package.json"));
|
13
|
-
const currentVersion = package_json_1.default.version;
|
14
|
-
const tag = config_1.default.staging ? 'dev' : 'latest';
|
15
12
|
class AutoUpdateTask extends BaseTask_1.BaseTask {
|
16
13
|
constructor() {
|
17
14
|
super({
|
18
15
|
logger: new logger_1.default("AutoUpdateTask"),
|
19
16
|
});
|
20
|
-
this.pollIntervalMs = 60 *
|
17
|
+
this.pollIntervalMs = 60 * 5 * 1000;
|
21
18
|
}
|
22
19
|
prePollHandler() {
|
23
20
|
return config_1.default.autoUpdate && !config_1.default.isLeadNode();
|
24
21
|
}
|
25
|
-
|
26
|
-
|
27
|
-
const stdout = await (0, await_spawn_1.default)('npm', ['-g', 'ls', '--depth=0', '--json']);
|
28
|
-
return JSON.parse(stdout.toString()).dependencies[package_json_1.default.name].version;
|
29
|
-
}
|
30
|
-
catch (error) {
|
31
|
-
this.logger.error(error);
|
32
|
-
return currentVersion;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
async getLatestVersion() {
|
36
|
-
try {
|
37
|
-
const stdout = await (0, await_spawn_1.default)('npm', ['view', `${package_json_1.default.name}@${tag}`, 'version']);
|
38
|
-
return stdout.toString().trim();
|
39
|
-
}
|
40
|
-
catch (error) {
|
41
|
-
this.logger.error(error);
|
42
|
-
return currentVersion;
|
43
|
-
}
|
22
|
+
getCurrentVersion() {
|
23
|
+
return require('../../package.json').version;
|
44
24
|
}
|
45
25
|
async pollHandler() {
|
46
|
-
const
|
26
|
+
const { data } = await utils_1.http.get('https://registry.npmjs.org/@instadapp/interop-x');
|
27
|
+
const version = data['dist-tags'].latest;
|
28
|
+
const currentVersion = this.getCurrentVersion();
|
47
29
|
if (version === currentVersion) {
|
48
30
|
return;
|
49
31
|
}
|
50
32
|
this.logger.warn(`New version ${version} available.`);
|
51
|
-
|
52
|
-
await (0, await_spawn_1.default)('npm', ['-g', 'install', `@instadapp/interop-x@${tag}`, '-f']);
|
33
|
+
await (0, await_spawn_1.default)('npm', ['-g', 'install', '@instadapp/interop-x', '-f']);
|
53
34
|
await (0, waait_1.default)(5000);
|
54
|
-
if (
|
35
|
+
if (currentVersion === this.getCurrentVersion()) {
|
55
36
|
this.logger.warn(`failed to install ${version}, retrying in 5 minutes`);
|
56
37
|
return;
|
57
38
|
}
|
58
39
|
this.logger.warn(`Installed version ${version}`);
|
59
40
|
this.logger.warn(`Restarting...`);
|
60
|
-
|
61
|
-
const subprocess = (0, child_process_1.spawn)(process.argv[0], process.argv.slice(1), {
|
41
|
+
(0, await_spawn_1.default)(process.argv[0], process.argv.slice(1), {
|
62
42
|
cwd: process.cwd(),
|
63
|
-
stdio: "inherit"
|
64
|
-
// shell: process.env.SHELL,
|
43
|
+
stdio: "inherit"
|
65
44
|
});
|
66
|
-
subprocess.unref();
|
67
45
|
process.exit();
|
68
46
|
}
|
69
47
|
}
|
@@ -35,10 +35,6 @@ class BaseTask extends events_1.default {
|
|
35
35
|
}
|
36
36
|
}
|
37
37
|
prePollHandler() {
|
38
|
-
if (config_1.default.isMaintenanceMode()) {
|
39
|
-
this.logger.warn('Maintenance mode is enabled. Skipping task.');
|
40
|
-
return false;
|
41
|
-
}
|
42
38
|
if (this.exceptLeadNode) {
|
43
39
|
return !config_1.default.isLeadNode();
|
44
40
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@instadapp/interop-x",
|
3
|
-
"version": "0.0.0-dev.
|
3
|
+
"version": "0.0.0-dev.43cb9e6",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"engines": {
|
@@ -28,6 +28,7 @@
|
|
28
28
|
"await-spawn": "^4.0.2",
|
29
29
|
"axios": "^0.27.1",
|
30
30
|
"axios-retry": "^3.2.4",
|
31
|
+
"bignumber.js": "^9.0.2",
|
31
32
|
"chalk": "4.1.2",
|
32
33
|
"dotenv": "^16.0.0",
|
33
34
|
"ethereumjs-util": "^7.1.4",
|
@@ -35,7 +36,6 @@
|
|
35
36
|
"ethers-multisend": "^2.1.1",
|
36
37
|
"expand-home-dir": "^0.0.3",
|
37
38
|
"fastify": "^3.28.0",
|
38
|
-
"fs-extra": "^10.1.0",
|
39
39
|
"libp2p": "^0.36.2",
|
40
40
|
"libp2p-bootstrap": "^0.14.0",
|
41
41
|
"libp2p-kad-dht": "^0.28.6",
|
package/src/config/index.ts
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
import { ethers, Wallet } from "ethers"
|
2
2
|
import { EventBus, EventBusType } from "@/types"
|
3
|
-
import fs from 'fs-extra'
|
4
|
-
import expandHomeDir from "expand-home-dir";
|
5
3
|
|
6
4
|
class Config {
|
7
5
|
public readonly events: EventBusType
|
@@ -11,17 +9,15 @@ class Config {
|
|
11
9
|
public readonly wallet: Wallet
|
12
10
|
public readonly staging: boolean
|
13
11
|
public readonly autoUpdate: boolean
|
14
|
-
public readonly baseConfigPath: string
|
15
12
|
|
16
13
|
constructor() {
|
17
14
|
this.events = new EventBus() as EventBusType
|
18
|
-
this.maxPeers =
|
15
|
+
this.maxPeers = 10
|
19
16
|
this.privateKey = process.env.PRIVATE_KEY as string;
|
20
17
|
this.staging = !! process.env.STAGING && process.env.STAGING === 'true';
|
21
18
|
this.autoUpdate = !! process.env.AUTO_UPDATE && process.env.AUTO_UPDATE === 'true';
|
22
19
|
this.wallet = new Wallet(this.privateKey);
|
23
20
|
this.leadNodeAddress = '0x910E413DBF3F6276Fe8213fF656726bDc142E08E'
|
24
|
-
this.baseConfigPath = expandHomeDir(`~/.interop-x`);
|
25
21
|
}
|
26
22
|
|
27
23
|
get publicAddress(){
|
@@ -31,10 +27,6 @@ class Config {
|
|
31
27
|
isLeadNode() {
|
32
28
|
return ethers.utils.getAddress(this.leadNodeAddress) === ethers.utils.getAddress(this.wallet.address)
|
33
29
|
}
|
34
|
-
|
35
|
-
isMaintenanceMode(){
|
36
|
-
return fs.existsSync(this.baseConfigPath + '/maintenance')
|
37
|
-
}
|
38
30
|
}
|
39
31
|
|
40
32
|
export default new Config()
|
package/src/index.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import moduleAlias from 'module-alias';
|
2
|
-
|
3
|
-
import fs from 'fs-extra'
|
2
|
+
|
4
3
|
moduleAlias.addAliases({
|
5
4
|
"@/": __dirname + "/",
|
6
5
|
"@/logger": __dirname + "/logger",
|
@@ -26,30 +25,12 @@ dotenv.config();
|
|
26
25
|
import Logger from "@/logger";
|
27
26
|
const logger = new Logger('Process')
|
28
27
|
|
29
|
-
const GIT_SHORT_HASH = '@GIT_SHORT_HASH@';
|
30
|
-
|
31
28
|
const printUsage = () => {
|
32
|
-
console.log()
|
33
|
-
console.log(`Interop X Node (v${packageJson.version} - rev.${GIT_SHORT_HASH})`)
|
34
|
-
console.log()
|
35
|
-
|
36
29
|
console.log('Usage:')
|
37
|
-
console.log(' interop-x
|
38
|
-
console.log(' interop-x
|
39
|
-
|
40
|
-
console.log()
|
41
|
-
|
42
|
-
console.log(' interop-x down Put the node into maintenance mode')
|
43
|
-
console.log(' interop-x up Take the node out of maintenance mode')
|
44
|
-
|
45
|
-
console.log()
|
46
|
-
|
47
|
-
console.log(' PRIVATE_KEY=abcd1234 interop-x start Start the node with the given private key')
|
48
|
-
console.log(' PRIVATE_KEY=abcd1234 STAGING=true interop-x Start the node in staging mode')
|
49
|
-
console.log(' PRIVATE_KEY=abcd1234 AUTO_UPDATE=true interop-x Start the node in auto update mode')
|
50
|
-
console.log(' PRIVATE_KEY=abcd1234 API_HOST=0.0.0.0 API_PORT=8080 interop-x Start the node with custom API host and port')
|
51
|
-
console.log()
|
52
|
-
|
30
|
+
console.log(' PRIVATE_KEY=abcd1234 interop-x')
|
31
|
+
console.log(' PRIVATE_KEY=abcd1234 STAGING=true interop-x')
|
32
|
+
console.log(' PRIVATE_KEY=abcd1234 AUTO_UPDATE=true interop-x')
|
33
|
+
console.log(' PRIVATE_KEY=abcd1234 API_HOST=0.0.0.0 API_PORT=8080 interop-x')
|
53
34
|
}
|
54
35
|
|
55
36
|
if (process.argv.at(-1) === 'help') {
|
@@ -57,27 +38,14 @@ if (process.argv.at(-1) === 'help') {
|
|
57
38
|
process.exit(0)
|
58
39
|
}
|
59
40
|
|
60
|
-
const
|
61
|
-
|
62
|
-
if (process.argv.at(-1) === 'down') {
|
63
|
-
fs.outputFileSync(basePath + '/maintenance', Date.now().toString())
|
64
|
-
console.log(chalk.red('Maintenance mode enabled'))
|
65
|
-
process.exit(0)
|
66
|
-
}
|
67
|
-
|
68
|
-
if (process.argv.at(-1) === 'up') {
|
69
|
-
fs.removeSync(basePath + '/maintenance')
|
70
|
-
console.log(chalk.green('Maintenance mode disabled'))
|
71
|
-
process.exit(0)
|
72
|
-
}
|
73
|
-
|
41
|
+
const GIT_SHORT_HASH = '@GIT_SHORT_HASH@';
|
74
42
|
|
75
43
|
if (process.argv.at(-1) === 'version') {
|
76
44
|
console.log(`Interop X Node (v${packageJson.version} - rev.${GIT_SHORT_HASH})`)
|
77
45
|
process.exit(0)
|
78
46
|
}
|
79
47
|
|
80
|
-
if
|
48
|
+
if(! process.env.PRIVATE_KEY) {
|
81
49
|
console.error(chalk.bgRed.white.bold('Please provide a private key\n'))
|
82
50
|
printUsage()
|
83
51
|
process.exit(1)
|
@@ -112,10 +80,10 @@ async function main() {
|
|
112
80
|
if (!peerPool.isLeadNode(payload.peerId)) {
|
113
81
|
const peer = peerPool.getPeer(payload.peerId)
|
114
82
|
|
115
|
-
if
|
83
|
+
if(! peer) {
|
116
84
|
return;
|
117
85
|
}
|
118
|
-
|
86
|
+
|
119
87
|
logger.info(`ignored transaction status from ${payload.peerId} ${shortenHash(peer.publicAddress)} `)
|
120
88
|
return;
|
121
89
|
}
|
@@ -1,16 +1,12 @@
|
|
1
1
|
import { BaseTask } from "./BaseTask";
|
2
2
|
import Logger from '@/logger';
|
3
|
-
import
|
4
|
-
import
|
3
|
+
import { http } from "@/utils";
|
4
|
+
import spawn from 'await-spawn';
|
5
5
|
import config from "@/config";
|
6
6
|
import wait from "waait";
|
7
|
-
import packageJson from "../../package.json";
|
8
|
-
|
9
|
-
const currentVersion = packageJson.version;
|
10
|
-
const tag = config.staging ? 'dev' : 'latest';
|
11
7
|
|
12
8
|
class AutoUpdateTask extends BaseTask {
|
13
|
-
pollIntervalMs: number = 60 *
|
9
|
+
pollIntervalMs: number = 60 * 5 * 1000
|
14
10
|
|
15
11
|
constructor() {
|
16
12
|
super({
|
@@ -22,28 +18,15 @@ class AutoUpdateTask extends BaseTask {
|
|
22
18
|
return config.autoUpdate && !config.isLeadNode();
|
23
19
|
}
|
24
20
|
|
25
|
-
|
26
|
-
|
27
|
-
const stdout = await spawnAsync('npm', ['-g', 'ls', '--depth=0', '--json'])
|
28
|
-
return JSON.parse(stdout.toString()).dependencies[packageJson.name].version
|
29
|
-
} catch (error) {
|
30
|
-
this.logger.error(error)
|
31
|
-
return currentVersion
|
32
|
-
}
|
21
|
+
getCurrentVersion() {
|
22
|
+
return require('../../package.json').version
|
33
23
|
}
|
24
|
+
async pollHandler() {
|
34
25
|
|
35
|
-
|
36
|
-
try {
|
37
|
-
const stdout = await spawnAsync('npm', ['view', `${packageJson.name}@${tag}`, 'version'])
|
38
|
-
return stdout.toString().trim()
|
39
|
-
} catch (error) {
|
40
|
-
this.logger.error(error)
|
41
|
-
return currentVersion
|
42
|
-
}
|
43
|
-
}
|
26
|
+
const { data } = await http.get('https://registry.npmjs.org/@instadapp/interop-x')
|
44
27
|
|
45
|
-
|
46
|
-
const
|
28
|
+
const version = data['dist-tags'].latest
|
29
|
+
const currentVersion = this.getCurrentVersion()
|
47
30
|
|
48
31
|
if (version === currentVersion) {
|
49
32
|
return;
|
@@ -51,13 +34,13 @@ class AutoUpdateTask extends BaseTask {
|
|
51
34
|
|
52
35
|
this.logger.warn(`New version ${version} available.`)
|
53
36
|
|
54
|
-
this.logger.info('Updating...')
|
55
37
|
|
56
|
-
await
|
38
|
+
await spawn('npm', ['-g', 'install', '@instadapp/interop-x', '-f']);
|
39
|
+
|
57
40
|
|
58
41
|
await wait(5000)
|
59
42
|
|
60
|
-
if (
|
43
|
+
if (currentVersion === this.getCurrentVersion()) {
|
61
44
|
this.logger.warn(`failed to install ${version}, retrying in 5 minutes`)
|
62
45
|
return;
|
63
46
|
}
|
@@ -65,16 +48,11 @@ class AutoUpdateTask extends BaseTask {
|
|
65
48
|
this.logger.warn(`Installed version ${version}`)
|
66
49
|
this.logger.warn(`Restarting...`)
|
67
50
|
|
68
|
-
|
69
|
-
// TODO: its restarting in the bg, but it should be in the fg
|
70
|
-
const subprocess = spawn(process.argv[0], process.argv.slice(1), {
|
51
|
+
spawn(process.argv[0], process.argv.slice(1), {
|
71
52
|
cwd: process.cwd(),
|
72
|
-
stdio: "inherit"
|
73
|
-
// shell: process.env.SHELL,
|
53
|
+
stdio: "inherit"
|
74
54
|
});
|
75
55
|
|
76
|
-
subprocess.unref();
|
77
|
-
|
78
56
|
process.exit()
|
79
57
|
}
|
80
58
|
}
|
package/src/tasks/BaseTask.ts
CHANGED
@@ -46,11 +46,6 @@ export class BaseTask extends EventEmitter implements IBaseTask {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
prePollHandler(): boolean {
|
49
|
-
if(config.isMaintenanceMode()){
|
50
|
-
this.logger.warn('Maintenance mode is enabled. Skipping task.')
|
51
|
-
return false
|
52
|
-
}
|
53
|
-
|
54
49
|
if (this.exceptLeadNode) {
|
55
50
|
return !config.isLeadNode();
|
56
51
|
}
|