update backend stuck/stall

This commit is contained in:
Matthias Hochmeister
2026-03-13 08:30:05 +01:00
parent 60488309ca
commit 243da302c7
9 changed files with 199 additions and 156 deletions

View File

@@ -1,4 +1,5 @@
import axios from 'axios';
import httpClient from '../config/httpClient';
import environment from '../config/environment';
import logger from '../utils/logger';
@@ -89,7 +90,7 @@ function buildHeaders(): Record<string, string> {
async function getBookSlugMap(): Promise<Map<number, string>> {
const { bookstack } = environment;
try {
const response = await axios.get(
const response = await httpClient.get(
`${bookstack.url}/api/books`,
{ params: { count: 500 }, headers: buildHeaders() },
);
@@ -108,7 +109,7 @@ async function getRecentPages(): Promise<BookStackPage[]> {
try {
const [response, bookSlugMap] = await Promise.all([
axios.get(
httpClient.get(
`${bookstack.url}/api/pages`,
{
params: { sort: '-updated_at', count: 20 },
@@ -141,7 +142,7 @@ async function searchPages(query: string): Promise<BookStackSearchResult[]> {
}
try {
const response = await axios.get(
const response = await httpClient.get(
`${bookstack.url}/api/search`,
{
params: { query, count: 50 },
@@ -197,7 +198,7 @@ async function getPageById(id: number): Promise<BookStackPageDetail> {
try {
const [response, bookSlugMap] = await Promise.all([
axios.get(
httpClient.get(
`${bookstack.url}/api/pages/${id}`,
{ headers: buildHeaders() },
),