✌️
This commit is contained in:
@@ -50,7 +50,7 @@ export class FetchInstanceMetadataService {
|
||||
private redisClient: Redis.Redis,
|
||||
) {
|
||||
this.logger = this.loggerService.getLogger('metadata', 'cyan');
|
||||
this.httpColon = 'http://';
|
||||
this.httpColon = process.env.MISSKEY_USE_HTTP?.toLowerCase() === 'true' ? 'http://' : 'https://';
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
@@ -46,7 +46,7 @@ export class WebfingerService {
|
||||
const m = query.match(mRegex);
|
||||
if (m) {
|
||||
const hostname = m[2];
|
||||
const useHttp = process.env.MISSKEY_WEBFINGER_USE_HTTP && process.env.MISSKEY_WEBFINGER_USE_HTTP.toLowerCase() === 'true';
|
||||
const useHttp = process.env.MISSKEY_USE_HTTP && process.env.MISSKEY_USE_HTTP.toLowerCase() === 'true';
|
||||
return `http${useHttp ? '' : 's'}://${hostname}/.well-known/webfinger?${urlQuery({ resource: `acct:${query}` })}`;
|
||||
}
|
||||
|
||||
|
@@ -256,9 +256,11 @@ export class ApPersonService implements OnModuleInit {
|
||||
// ついでにリモートユーザーの情報が古かったら更新しておく
|
||||
if (this.userEntityService.isRemoteUser(exist)) {
|
||||
if (exist.lastFetchedAt == null || Date.now() - exist.lastFetchedAt.getTime() > 1000 * 60 * 60 * 3) {
|
||||
this.logger.debug('fetchPersonWithRenewal: renew', { uri, lastFetchedAt: exist.lastFetchedAt });
|
||||
await this.updatePerson(exist.uri);
|
||||
return await this.fetchPerson(uri);
|
||||
}
|
||||
this.logger.debug('fetchPersonWithRenewal: use cache', { uri, lastFetchedAt: exist.lastFetchedAt });
|
||||
}
|
||||
|
||||
return exist;
|
||||
|
Reference in New Issue
Block a user