update cron schedule and const definitions
This commit is contained in:
parent
37b07c642b
commit
3f406f962c
86
package.json
86
package.json
|
@ -1,6 +1,86 @@
|
|||
{
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
"name": "skynet-webportal",
|
||||
"description": "Sia Skynet",
|
||||
"version": "1.0.0",
|
||||
"author": "Nebulous",
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"bytes": "^3.1.0",
|
||||
"classnames": "^2.2.6",
|
||||
"gatsby": "^2.24.5",
|
||||
"gatsby-image": "^2.4.13",
|
||||
"gatsby-plugin-manifest": "^2.4.18",
|
||||
"gatsby-plugin-matomo": "^0.8.3",
|
||||
"gatsby-plugin-react-helmet": "^3.3.10",
|
||||
"gatsby-plugin-remove-serviceworker": "^1.0.0",
|
||||
"gatsby-plugin-robots-txt": "^1.5.1",
|
||||
"gatsby-plugin-sass": "^2.3.12",
|
||||
"gatsby-plugin-sharp": "^2.6.20",
|
||||
"gatsby-source-filesystem": "^2.3.20",
|
||||
"gatsby-transformer-sharp": "^2.5.11",
|
||||
"http-status-codes": "^1.4.0",
|
||||
"jsonp": "^0.2.1",
|
||||
"node-sass": "^4.14.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^16.13.1",
|
||||
"react-countup": "^4.3.3",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-dropzone": "^11.0.2",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-mailchimp-form": "^1.0.2",
|
||||
"react-mailchimp-subscribe": "^2.1.0",
|
||||
"react-reveal": "^1.2.2",
|
||||
"react-syntax-highlighter": "^12.2.1",
|
||||
"react-visibility-sensor": "^5.1.1",
|
||||
"skynet-js": "0.0.8",
|
||||
"typeface-metropolis": "^0.0.74"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cypress": "^4.10.0",
|
||||
"cypress-file-upload": "^4.0.7",
|
||||
"eslint": "^7.5.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-cypress": "^2.11.1",
|
||||
"eslint-plugin-react": "^7.20.3",
|
||||
"husky": "^4.2.5",
|
||||
"lint-staged": "^10.2.11",
|
||||
"prettier": "^2.0.5"
|
||||
},
|
||||
"keywords": [
|
||||
"sia",
|
||||
"skynet",
|
||||
"nebulous",
|
||||
"blockchain",
|
||||
"decentralized",
|
||||
"cloud storage"
|
||||
],
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "gatsby build",
|
||||
"start": "gatsby develop",
|
||||
"serve": "gatsby serve",
|
||||
"clean": "gatsby clean"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx}": [
|
||||
"eslint --fix",
|
||||
"prettier --write"
|
||||
],
|
||||
"*.{md,html,css,scss}": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/NebulousLabs/skynet-webportal"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/NebulousLabs/skynet-webportal/issues"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ const basicJob = schedule.scheduleJob("*/5 * * * *", async () => {
|
|||
});
|
||||
|
||||
// execute the verbose health-check script once a day at 3am
|
||||
const verboseJob = schedule.scheduleJob("* * 3 * * *", async () => {
|
||||
const verboseJob = schedule.scheduleJob("* 3 * * *", async () => {
|
||||
const entry = { date: new Date().toISOString(), checks: [] };
|
||||
|
||||
entry.checks = await Promise.all(verboseChecks.map((check) => new Promise(check)));
|
||||
|
|
|
@ -227,7 +227,7 @@ function skylinkVerification(done, linkInfo) {
|
|||
const time = process.hrtime();
|
||||
|
||||
// Create the query for the skylink
|
||||
let query = `http://${process.env.PORTAL_URL}/${linkInfo.skylink}?nocache=true`;
|
||||
const query = `http://${process.env.PORTAL_URL}/${linkInfo.skylink}?nocache=true`;
|
||||
|
||||
// Get the Skylink
|
||||
superagent
|
||||
|
@ -243,10 +243,10 @@ function skylinkVerification(done, linkInfo) {
|
|||
if (up) {
|
||||
// Check if the response body is valid by checking against the known
|
||||
// hash
|
||||
let validBody = hash(res.body) === linkInfo.bodyHash;
|
||||
const validBody = hash(res.body) === linkInfo.bodyHash;
|
||||
// Check if the metadata is valid by checking against the known
|
||||
// hash
|
||||
let validMetadata = hash(res.header["skynet-file-metadata"]) === linkInfo.metadataHash;
|
||||
const validMetadata = hash(res.header["skynet-file-metadata"]) === linkInfo.metadataHash;
|
||||
// Redetermine if the Skylink is up based on the results from the body
|
||||
// and metadata hash checks
|
||||
up = up && validBody && validMetadata;
|
||||
|
|
Reference in New Issue