summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/FetchInstanceMetadataService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/FetchInstanceMetadataService.ts')
-rw-r--r--packages/backend/src/core/FetchInstanceMetadataService.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/backend/src/core/FetchInstanceMetadataService.ts b/packages/backend/src/core/FetchInstanceMetadataService.ts
index 980f1fcacf..9bfd7381f1 100644
--- a/packages/backend/src/core/FetchInstanceMetadataService.ts
+++ b/packages/backend/src/core/FetchInstanceMetadataService.ts
@@ -15,6 +15,7 @@ import { LoggerService } from '@/core/LoggerService.js';
import { HttpRequestService } from '@/core/HttpRequestService.js';
import { bindThis } from '@/decorators.js';
import { FederatedInstanceService } from '@/core/FederatedInstanceService.js';
+import { renderInlineError } from '@/misc/render-inline-error.js';
import type { CheerioAPI } from 'cheerio';
type NodeInfo = {
@@ -90,7 +91,7 @@ export class FetchInstanceMetadataService {
}
}
- this.logger.info(`Fetching metadata of ${instance.host} ...`);
+ this.logger.debug(`Fetching metadata of ${instance.host} ...`);
const [info, dom, manifest] = await Promise.all([
this.fetchNodeinfo(instance).catch(() => null),
@@ -106,7 +107,7 @@ export class FetchInstanceMetadataService {
this.getDescription(info, dom, manifest).catch(() => null),
]);
- this.logger.succ(`Successfuly fetched metadata of ${instance.host}`);
+ this.logger.debug(`Successfuly fetched metadata of ${instance.host}`);
const updates = {
infoUpdatedAt: new Date(),
@@ -128,9 +129,9 @@ export class FetchInstanceMetadataService {
await this.federatedInstanceService.update(instance.id, updates);
- this.logger.succ(`Successfuly updated metadata of ${instance.host}`);
+ this.logger.info(`Successfully updated metadata of ${instance.host}`);
} catch (e) {
- this.logger.error(`Failed to update metadata of ${instance.host}: ${e}`);
+ this.logger.error(`Failed to update metadata of ${instance.host}: ${renderInlineError(e)}`);
} finally {
await this.unlock(host);
}
@@ -138,7 +139,7 @@ export class FetchInstanceMetadataService {
@bindThis
private async fetchNodeinfo(instance: MiInstance): Promise<NodeInfo> {
- this.logger.info(`Fetching nodeinfo of ${instance.host} ...`);
+ this.logger.debug(`Fetching nodeinfo of ${instance.host} ...`);
try {
const wellknown = await this.httpRequestService.getJson('https://' + instance.host + '/.well-known/nodeinfo')
@@ -170,11 +171,11 @@ export class FetchInstanceMetadataService {
throw err.statusCode ?? err.message;
});
- this.logger.succ(`Successfuly fetched nodeinfo of ${instance.host}`);
+ this.logger.debug(`Successfuly fetched nodeinfo of ${instance.host}`);
return info as NodeInfo;
} catch (err) {
- this.logger.error(`Failed to fetch nodeinfo of ${instance.host}: ${err}`);
+ this.logger.warn(`Failed to fetch nodeinfo of ${instance.host}: ${renderInlineError(err)}`);
throw err;
}
@@ -182,7 +183,7 @@ export class FetchInstanceMetadataService {
@bindThis
private async fetchDom(instance: MiInstance): Promise<CheerioAPI> {
- this.logger.info(`Fetching HTML of ${instance.host} ...`);
+ this.logger.debug(`Fetching HTML of ${instance.host} ...`);
const url = 'https://' + instance.host;