drop latestRequestSentAt of instance
This commit is contained in:
		
							parent
							
								
									771348e887
								
							
						
					
					
						commit
						7093573f0c
					
				
					 7 changed files with 18 additions and 28 deletions
				
			
		|  | @ -167,7 +167,6 @@ annotation: "注釈" | ||||||
| federation: "連合" | federation: "連合" | ||||||
| instances: "インスタンス" | instances: "インスタンス" | ||||||
| registeredAt: "初観測" | registeredAt: "初観測" | ||||||
| latestRequestSentAt: "直近のリクエスト送信" |  | ||||||
| latestRequestReceivedAt: "直近のリクエスト受信" | latestRequestReceivedAt: "直近のリクエスト受信" | ||||||
| latestStatus: "直近のステータス" | latestStatus: "直近のステータス" | ||||||
| storageUsage: "ストレージ使用量" | storageUsage: "ストレージ使用量" | ||||||
|  |  | ||||||
|  | @ -0,0 +1,11 @@ | ||||||
|  | export class removeLatestRequestSentAt1672703171386 { | ||||||
|  |     name = 'removeLatestRequestSentAt1672703171386' | ||||||
|  | 
 | ||||||
|  |     async up(queryRunner) { | ||||||
|  |         await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "latestRequestSentAt"`); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     async down(queryRunner) { | ||||||
|  |         await queryRunner.query(`ALTER TABLE "instance" ADD "latestRequestSentAt" TIMESTAMP WITH TIME ZONE`); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -7,8 +7,8 @@ import type { } from '@/models/entities/Blocking.js'; | ||||||
| import type { User } from '@/models/entities/User.js'; | import type { User } from '@/models/entities/User.js'; | ||||||
| import type { Instance } from '@/models/entities/Instance.js'; | import type { Instance } from '@/models/entities/Instance.js'; | ||||||
| import { MetaService } from '@/core/MetaService.js'; | import { MetaService } from '@/core/MetaService.js'; | ||||||
| import { UserEntityService } from './UserEntityService.js'; |  | ||||||
| import { bindThis } from '@/decorators.js'; | import { bindThis } from '@/decorators.js'; | ||||||
|  | import { UserEntityService } from './UserEntityService.js'; | ||||||
| 
 | 
 | ||||||
| @Injectable() | @Injectable() | ||||||
| export class InstanceEntityService { | export class InstanceEntityService { | ||||||
|  | @ -33,7 +33,6 @@ export class InstanceEntityService { | ||||||
| 			notesCount: instance.notesCount, | 			notesCount: instance.notesCount, | ||||||
| 			followingCount: instance.followingCount, | 			followingCount: instance.followingCount, | ||||||
| 			followersCount: instance.followersCount, | 			followersCount: instance.followersCount, | ||||||
| 			latestRequestSentAt: instance.latestRequestSentAt ? instance.latestRequestSentAt.toISOString() : null, |  | ||||||
| 			lastCommunicatedAt: instance.lastCommunicatedAt.toISOString(), | 			lastCommunicatedAt: instance.lastCommunicatedAt.toISOString(), | ||||||
| 			isNotResponding: instance.isNotResponding, | 			isNotResponding: instance.isNotResponding, | ||||||
| 			isSuspended: instance.isSuspended, | 			isSuspended: instance.isSuspended, | ||||||
|  |  | ||||||
|  | @ -59,14 +59,6 @@ export class Instance { | ||||||
| 	}) | 	}) | ||||||
| 	public followersCount: number; | 	public followersCount: number; | ||||||
| 
 | 
 | ||||||
| 	/** |  | ||||||
| 	 * 直近のリクエスト送信日時 |  | ||||||
| 	 */ |  | ||||||
| 	@Column('timestamp with time zone', { |  | ||||||
| 		nullable: true, |  | ||||||
| 	}) |  | ||||||
| 	public latestRequestSentAt: Date | null; |  | ||||||
| 
 |  | ||||||
| 	/** | 	/** | ||||||
| 	 * 直近のリクエスト送信時のHTTPステータスコード | 	 * 直近のリクエスト送信時のHTTPステータスコード | ||||||
| 	 */ | 	 */ | ||||||
|  |  | ||||||
|  | @ -32,11 +32,6 @@ export const packedFederationInstanceSchema = { | ||||||
| 			type: 'number', | 			type: 'number', | ||||||
| 			optional: false, nullable: false, | 			optional: false, nullable: false, | ||||||
| 		}, | 		}, | ||||||
| 		latestRequestSentAt: { |  | ||||||
| 			type: 'string', |  | ||||||
| 			optional: false, nullable: true, |  | ||||||
| 			format: 'date-time', |  | ||||||
| 		}, |  | ||||||
| 		lastCommunicatedAt: { | 		lastCommunicatedAt: { | ||||||
| 			type: 'string', | 			type: 'string', | ||||||
| 			optional: false, nullable: false, | 			optional: false, nullable: false, | ||||||
|  |  | ||||||
|  | @ -15,10 +15,10 @@ import ApRequestChart from '@/core/chart/charts/ap-request.js'; | ||||||
| import FederationChart from '@/core/chart/charts/federation.js'; | import FederationChart from '@/core/chart/charts/federation.js'; | ||||||
| import { StatusError } from '@/misc/status-error.js'; | import { StatusError } from '@/misc/status-error.js'; | ||||||
| import { UtilityService } from '@/core/UtilityService.js'; | import { UtilityService } from '@/core/UtilityService.js'; | ||||||
|  | import { bindThis } from '@/decorators.js'; | ||||||
| import { QueueLoggerService } from '../QueueLoggerService.js'; | import { QueueLoggerService } from '../QueueLoggerService.js'; | ||||||
| import type Bull from 'bull'; | import type Bull from 'bull'; | ||||||
| import type { DeliverJobData } from '../types.js'; | import type { DeliverJobData } from '../types.js'; | ||||||
| import { bindThis } from '@/decorators.js'; |  | ||||||
| 
 | 
 | ||||||
| @Injectable() | @Injectable() | ||||||
| export class DeliverProcessorService { | export class DeliverProcessorService { | ||||||
|  | @ -85,7 +85,6 @@ export class DeliverProcessorService { | ||||||
| 			// Update stats
 | 			// Update stats
 | ||||||
| 			this.federatedInstanceService.registerOrFetchInstanceDoc(host).then(i => { | 			this.federatedInstanceService.registerOrFetchInstanceDoc(host).then(i => { | ||||||
| 				this.instancesRepository.update(i.id, { | 				this.instancesRepository.update(i.id, { | ||||||
| 					latestRequestSentAt: new Date(), |  | ||||||
| 					latestStatus: 200, | 					latestStatus: 200, | ||||||
| 					lastCommunicatedAt: new Date(), | 					lastCommunicatedAt: new Date(), | ||||||
| 					isNotResponding: false, | 					isNotResponding: false, | ||||||
|  | @ -103,7 +102,6 @@ export class DeliverProcessorService { | ||||||
| 			// Update stats
 | 			// Update stats
 | ||||||
| 			this.federatedInstanceService.registerOrFetchInstanceDoc(host).then(i => { | 			this.federatedInstanceService.registerOrFetchInstanceDoc(host).then(i => { | ||||||
| 				this.instancesRepository.update(i.id, { | 				this.instancesRepository.update(i.id, { | ||||||
| 					latestRequestSentAt: new Date(), |  | ||||||
| 					latestStatus: res instanceof StatusError ? res.statusCode : null, | 					latestStatus: res instanceof StatusError ? res.statusCode : null, | ||||||
| 					isNotResponding: true, | 					isNotResponding: true, | ||||||
| 				}); | 				}); | ||||||
|  |  | ||||||
|  | @ -40,10 +40,6 @@ | ||||||
| 					<template #key>{{ i18n.ts.updatedAt }}</template> | 					<template #key>{{ i18n.ts.updatedAt }}</template> | ||||||
| 					<template #value><MkTime mode="detail" :time="instance.infoUpdatedAt"/></template> | 					<template #value><MkTime mode="detail" :time="instance.infoUpdatedAt"/></template> | ||||||
| 				</MkKeyValue> | 				</MkKeyValue> | ||||||
| 				<MkKeyValue oneline style="margin: 1em 0;"> |  | ||||||
| 					<template #key>{{ i18n.ts.latestRequestSentAt }}</template> |  | ||||||
| 					<template #value><MkTime v-if="instance.latestRequestSentAt" :time="instance.latestRequestSentAt"/><span v-else>N/A</span></template> |  | ||||||
| 				</MkKeyValue> |  | ||||||
| 				<MkKeyValue oneline style="margin: 1em 0;"> | 				<MkKeyValue oneline style="margin: 1em 0;"> | ||||||
| 					<template #key>{{ i18n.ts.latestStatus }}</template> | 					<template #key>{{ i18n.ts.latestStatus }}</template> | ||||||
| 					<template #value>{{ instance.latestStatus ? instance.latestStatus : 'N/A' }}</template> | 					<template #value>{{ instance.latestStatus ? instance.latestStatus : 'N/A' }}</template> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue