use TimeService everywhere in the backend
This commit is contained in:
parent
ed750fd990
commit
6cceca90f9
123 changed files with 550 additions and 285 deletions
|
|
@ -19,6 +19,7 @@ import { validateContentTypeSetAsActivityPub } from '@/core/activitypub/misc/val
|
|||
import type { IObject, IObjectWithId } from '@/core/activitypub/type.js';
|
||||
import { UtilityService } from '@/core/UtilityService.js';
|
||||
import { ApUtilityService } from '@/core/activitypub/ApUtilityService.js';
|
||||
import { TimeService } from '@/core/TimeService.js';
|
||||
import type { Response } from 'node-fetch';
|
||||
import type { Socket } from 'node:net';
|
||||
|
||||
|
|
@ -156,8 +157,10 @@ export class HttpRequestService {
|
|||
constructor(
|
||||
@Inject(DI.config)
|
||||
private config: Config,
|
||||
|
||||
private readonly apUtilityService: ApUtilityService,
|
||||
private readonly utilityService: UtilityService,
|
||||
private readonly timeService: TimeService,
|
||||
) {
|
||||
const cache = new CacheableLookup({
|
||||
maxTtl: 3600, // 1hours
|
||||
|
|
@ -343,7 +346,7 @@ export class HttpRequestService {
|
|||
this.utilityService.assertUrl(parsedUrl, allowHttp);
|
||||
|
||||
const controller = new AbortController();
|
||||
setTimeout(() => {
|
||||
this.timeService.startTimer(() => {
|
||||
controller.abort();
|
||||
}, timeout);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue