|
|
@ -133,13 +133,9 @@ export async function reserveCache(key: string): Promise<number> {
|
|
|
|
const reserveCacheRequest: ReserveCacheRequest = {
|
|
|
|
const reserveCacheRequest: ReserveCacheRequest = {
|
|
|
|
key
|
|
|
|
key
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const additionalHeaders = {
|
|
|
|
|
|
|
|
"Content-Type": "application/json"
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const response = await httpClient.postJson<ReserveCacheResponse>(
|
|
|
|
const response = await httpClient.postJson<ReserveCacheResponse>(
|
|
|
|
getCacheApiUrl("caches"),
|
|
|
|
getCacheApiUrl("caches"),
|
|
|
|
reserveCacheRequest,
|
|
|
|
reserveCacheRequest
|
|
|
|
additionalHeaders
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
return response?.result?.cacheId ?? -1;
|
|
|
|
return response?.result?.cacheId ?? -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -269,13 +265,9 @@ async function commitCache(
|
|
|
|
filesize: number
|
|
|
|
filesize: number
|
|
|
|
): Promise<ITypedResponse<null>> {
|
|
|
|
): Promise<ITypedResponse<null>> {
|
|
|
|
const commitCacheRequest: CommitCacheRequest = { size: filesize };
|
|
|
|
const commitCacheRequest: CommitCacheRequest = { size: filesize };
|
|
|
|
const additionalHeaders = {
|
|
|
|
|
|
|
|
"Content-Type": "application/json"
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
return await httpClient.postJson<null>(
|
|
|
|
return await httpClient.postJson<null>(
|
|
|
|
getCacheApiUrl(`caches/${cacheId.toString()}`),
|
|
|
|
getCacheApiUrl(`caches/${cacheId.toString()}`),
|
|
|
|
commitCacheRequest,
|
|
|
|
commitCacheRequest
|
|
|
|
additionalHeaders
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|