mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: use superagent
This commit is contained in:
1 parent
72eac9875f
commit
dba701077c
2 files changed
+8
-6
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.15.25",
|
"version": "2.15.26",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
"@types/koa": "^2.11.4",
|
"@types/koa": "^2.11.4",
|
||||||
"@types/koa-router": "^7.4.1",
|
"@types/koa-router": "^7.4.1",
|
||||||
"@types/koa-static-cache": "^5.1.0",
|
"@types/koa-static-cache": "^5.1.0",
|
||||||
"@types/lodash": "^4.14.167",
|
"@types/lodash": "^4.14.168",
|
||||||
"@types/lru-cache": "^5.1.0",
|
"@types/lru-cache": "^5.1.0",
|
||||||
"@types/minio": "^7.0.7",
|
"@types/minio": "^7.0.7",
|
||||||
"@types/mongodb": "^3.5.33",
|
"@types/mongodb": "^3.5.33",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import cluster from 'cluster';
|
import cluster from 'cluster';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import axios from 'axios';
|
import superagent from 'superagent';
|
||||||
import { dump } from 'js-yaml';
|
import { dump } from 'js-yaml';
|
||||||
import db from './db';
|
import db from './db';
|
||||||
import * as bus from './bus';
|
import * as bus from './bus';
|
||||||
@@ -49,9 +49,11 @@ export async function feedback() {
|
|||||||
cpu: inf.cpu,
|
cpu: inf.cpu,
|
||||||
flags: inf.flags,
|
flags: inf.flags,
|
||||||
}));
|
}));
|
||||||
axios.post('https://feedback.undefined.moe/', { payload }).catch(() => {
|
superagent.post('https://feedback.undefined.moe/')
|
||||||
logger.warn('Cannot connect to hydro center.');
|
.send({ payload })
|
||||||
});
|
.catch(() => {
|
||||||
|
logger.warn('Cannot connect to hydro center.');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function update() {
|
export async function update() {
|
||||||
|
|||||||
Reference in new issue
Block a user