forked from Blendman974/faceclaw
CPU usage optimizations
This commit is contained in:
1 parent
95b2ca8afa
commit
3601a998a3
17 files changed
+494
-94
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { nightscoutApiTokenSetting, nightscoutSiteUrlSetting } from "../ui/dashboard-settings";
|
||||
import { fetchWithUserAgent } from "../util/http";
|
||||
import { fetchTextWithUserAgent } from "../util/http";
|
||||
|
||||
export type NightscoutPoint = {
|
||||
timestampMs: number;
|
||||
@@ -305,11 +305,11 @@ export class NightscoutBridge {
|
||||
}
|
||||
|
||||
async function fetchJson<T>(url: string): Promise<T> {
|
||||
const response = await fetchWithUserAgent(url);
|
||||
const response = await fetchTextWithUserAgent(url);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
return (await response.json()) as T;
|
||||
return response.json<T>();
|
||||
}
|
||||
|
||||
function parseTreatments(treatments: NightscoutTreatmentResponse[], nowMs: number): {
|
||||
|
||||
Reference in new issue
Block a user