summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/FetchInstanceMetadataService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-05-09 12:14:35 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-06-06 22:20:16 -0400
commitf42f9ee0b59d029d94378ee651c636e7541588f0 (patch)
treedc57e826c159d0b677fdd2758086e21e0040dcf5 /packages/backend/src/core/FetchInstanceMetadataService.ts
parentminimize logs from node-fetch FetchErrors (diff)
downloadsharkey-f42f9ee0b59d029d94378ee651c636e7541588f0.tar.gz
sharkey-f42f9ee0b59d029d94378ee651c636e7541588f0.tar.bz2
sharkey-f42f9ee0b59d029d94378ee651c636e7541588f0.zip
reduce log spam from FetchInstanceMetadataService.ts
Diffstat (limited to 'packages/backend/src/core/FetchInstanceMetadataService.ts')
-rw-r--r--packages/backend/src/core/FetchInstanceMetadataService.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/backend/src/core/FetchInstanceMetadataService.ts b/packages/backend/src/core/FetchInstanceMetadataService.ts
index 9f745f9459..469083a1e6 100644
--- a/packages/backend/src/core/FetchInstanceMetadataService.ts
+++ b/packages/backend/src/core/FetchInstanceMetadataService.ts
@@ -91,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),
@@ -107,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(),
@@ -129,7 +129,7 @@ export class FetchInstanceMetadataService {
await this.federatedInstanceService.update(instance.id, updates);
- this.logger.succ(`Successfuly updated metadata of ${instance.host}`);
+ this.logger.succ(`Successfully updated metadata of ${instance.host}`);
} catch (e) {
this.logger.error(`Failed to update metadata of ${instance.host}: ${renderInlineError(e)}`);
} finally {
@@ -139,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')
@@ -171,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;
}
@@ -183,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;