MCPcopy Index your code
hub / github.com/seerr-team/seerr / get

Method get

server/api/externalapi.ts:56–77  ·  view source on GitHub ↗
(
    endpoint: string,
    config?: AxiosRequestConfig,
    ttl?: number
  )

Source from the content-addressed store, hash-verified

54 }
55
56 protected async get<T>(
57 endpoint: string,
58 config?: AxiosRequestConfig,
59 ttl?: number
60 ): Promise<T> {
61 const cacheKey = this.serializeCacheKey(endpoint, {
62 ...config?.params,
63 headers: config?.headers,
64 });
65 const cachedItem = this.cache?.get<T>(cacheKey);
66 if (cachedItem) {
67 return cachedItem;
68 }
69
70 const response = await this.axios.get<T>(endpoint, config);
71
72 if (this.cache && ttl !== 0) {
73 this.cache.set(cacheKey, response.data, ttl ?? DEFAULT_TTL);
74 }
75
76 return response.data;
77 }
78
79 protected async post<T>(
80 endpoint: string,

Callers 8

postMethod · 0.45
getRollingMethod · 0.45
getStatusMethod · 0.45
getDevicesMethod · 0.45
getUsersMethod · 0.45
getWatchlistMethod · 0.45
pingTokenMethod · 0.45
AnimeListMappingClass · 0.45

Calls 2

serializeCacheKeyMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected