Skip to content

Commit

Permalink
Merge pull request #89 from orbs-network/stop_compressing_analytics
Browse files Browse the repository at this point in the history
no more compressing
  • Loading branch information
uv-orbs authored Dec 12, 2021
2 parents 0edbf80 + 12b5ad3 commit d32b0f6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"express": "^4.17.1",
"lodash": "^4.17.21",
"node-fetch": "^2.6.0",
"node-gzip": "^1.1.2",
"p-throttle": "^3.1.0",
"validate.js": "^0.13.1",
"web3": "1.2.6",
Expand Down
11 changes: 0 additions & 11 deletions src/status-writer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { mkdirSync, writeFileSync } from 'fs';
import { dirname } from 'path';
import { gzip } from 'node-gzip';
import { StateManager } from './model/manager';
import { ServiceConfiguration } from './config';
import { renderServiceStatus, renderServiceStatusAnalytics } from './api/render-status';
Expand All @@ -20,7 +19,6 @@ export class StatusWriter {
// do the actual writing to local files
writeFile(this.config.StatusJsonPath, status);
writeFile(this.config.StatusAnalyticsJsonPath, statusAnalytics);
await writeFileCompress(this.config.StatusAnalyticsJsonGzipPath, statusAnalytics);

await sleep(0); // for eslint
}
Expand All @@ -35,15 +33,6 @@ function writeFile(filePath: string, jsonObject: any) {
Logger.log(`Wrote status JSON to ${filePath} (${content.length} bytes).`);
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function writeFileCompress(filePath: string, jsonObject: any) {
ensureFileDirectoryExists(filePath);
const content = await gzip(JSON.stringify(jsonObject, null, 2));
writeFileSync(filePath, content);
// log progress
Logger.log(`Wrote status JSON compressed to ${filePath} (${content.length} bytes).`);
}

export function ensureFileDirectoryExists(filePath: string) {
mkdirSync(dirname(filePath), { recursive: true });
}

0 comments on commit d32b0f6

Please sign in to comment.