From c3711a2b577a10584bac0fbddfb7bde108eb706c Mon Sep 17 00:00:00 2001 From: Vijay A Date: Thu, 15 Jul 2021 23:10:08 +0530 Subject: Minor perf tweaks to evaluate capturing of env-specific values only once in the application. --- src/api/server/ServerApi.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/api/server') diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index 24d095556..c63aa7dda 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js @@ -1,4 +1,3 @@ -import os from 'os'; import path from 'path'; import tar from 'tar'; import fs from 'fs-extra'; @@ -15,7 +14,7 @@ import OrderModel from '../../models/Order'; import { sleep } from '../../helpers/async-helpers'; import { SERVER_NOT_LOADED } from '../../config'; -import { RECIPES_PATH } from '../../environment'; +import { osArch, osPlatform, RECIPES_PATH } from '../../environment'; import apiBase from '../apiBase'; import { prepareAuthRequest, sendAuthRequest } from '../utils/auth'; @@ -456,7 +455,7 @@ export default class ServerApi { // News async getLatestNews() { - const url = `${apiBase(true)}/news?platform=${os.platform()}&arch=${os.arch()}&version=${app.getVersion()}`; + const url = `${apiBase(true)}/news?platform=${osPlatform}&arch=${osArch}&version=${app.getVersion()}`; const request = await sendAuthRequest(url); if (!request.ok) throw request; const data = await request.json(); -- cgit v1.2.3-54-g00ecf