@whyour/qinglong 2.18.2-0 → 2.18.2-1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sample/notify.js +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
- "version": "2.18.2-0",
3
+ "version": "2.18.2-1",
4
4
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
5
  "repository": {
6
6
  "type": "git",
package/sample/notify.js CHANGED
@@ -428,7 +428,7 @@ function tgBotNotify(text, desp) {
428
428
  TG_PROXY_AUTH,
429
429
  } = push_config;
430
430
  if (TG_BOT_TOKEN && TG_USER_ID) {
431
- const options = {
431
+ let options = {
432
432
  url: `${TG_API_HOST}/bot${TG_BOT_TOKEN}/sendMessage`,
433
433
  json: {
434
434
  chat_id: `${TG_USER_ID}`,
@@ -442,20 +442,20 @@ function tgBotNotify(text, desp) {
442
442
  };
443
443
  if (TG_PROXY_HOST && TG_PROXY_PORT) {
444
444
  const { HttpProxyAgent, HttpsProxyAgent } = require('hpagent');
445
- const options = {
445
+ const _options = {
446
446
  keepAlive: true,
447
447
  keepAliveMsecs: 1000,
448
448
  maxSockets: 256,
449
449
  maxFreeSockets: 256,
450
450
  proxy: `http://${TG_PROXY_AUTH}${TG_PROXY_HOST}:${TG_PROXY_PORT}`,
451
451
  };
452
- const httpAgent = new HttpProxyAgent(options);
453
- const httpsAgent = new HttpsProxyAgent(options);
452
+ const httpAgent = new HttpProxyAgent(_options);
453
+ const httpsAgent = new HttpsProxyAgent(_options);
454
454
  const agent = {
455
455
  http: httpAgent,
456
456
  https: httpsAgent,
457
457
  };
458
- Object.assign(options, { agent });
458
+ options.agent = agent;
459
459
  }
460
460
  $.post(options, (err, resp, data) => {
461
461
  try {