kopia lustrzana https://github.com/cloudflare/wildebeest
				
				
				
			
						commit
						bd1f333cae
					
				|  | @ -1,4 +1,5 @@ | ||||||
| import type { InboxMessageBody } from 'wildebeest/backend/src/types/queue' | import type { InboxMessageBody } from 'wildebeest/backend/src/types/queue' | ||||||
|  | import { getDatabase } from 'wildebeest/backend/src/database' | ||||||
| import * as activityHandler from 'wildebeest/backend/src/activitypub/activities/handle' | import * as activityHandler from 'wildebeest/backend/src/activitypub/activities/handle' | ||||||
| import * as notification from 'wildebeest/backend/src/mastodon/notification' | import * as notification from 'wildebeest/backend/src/mastodon/notification' | ||||||
| import * as timeline from 'wildebeest/backend/src/mastodon/timeline' | import * as timeline from 'wildebeest/backend/src/mastodon/timeline' | ||||||
|  | @ -8,7 +9,7 @@ import type { Env } from './' | ||||||
| 
 | 
 | ||||||
| export async function handleInboxMessage(env: Env, actor: Actor, message: InboxMessageBody) { | export async function handleInboxMessage(env: Env, actor: Actor, message: InboxMessageBody) { | ||||||
| 	const domain = env.DOMAIN | 	const domain = env.DOMAIN | ||||||
| 	const db = getDatabase(env) | 	const db = getDatabase(env as any) | ||||||
| 	const adminEmail = env.ADMIN_EMAIL | 	const adminEmail = env.ADMIN_EMAIL | ||||||
| 	const cache = cacheFromEnv(env) | 	const cache = cacheFromEnv(env) | ||||||
| 	const activity = message.activity | 	const activity = message.activity | ||||||
|  |  | ||||||
|  | @ -20,10 +20,11 @@ export type Env = { | ||||||
| export default { | export default { | ||||||
| 	async queue(batch: MessageBatch<MessageBody>, env: Env, ctx: ExecutionContext) { | 	async queue(batch: MessageBatch<MessageBody>, env: Env, ctx: ExecutionContext) { | ||||||
| 		const sentry = initSentryQueue(env, ctx) | 		const sentry = initSentryQueue(env, ctx) | ||||||
|  | 		const db = getDatabase(env as any) | ||||||
| 
 | 
 | ||||||
| 		try { | 		try { | ||||||
| 			for (const message of batch.messages) { | 			for (const message of batch.messages) { | ||||||
| 				const actor = await actors.getActorById(getDatabase(env), new URL(message.body.actorId)) | 				const actor = await actors.getActorById(db, new URL(message.body.actorId)) | ||||||
| 				if (actor === null) { | 				if (actor === null) { | ||||||
| 					console.warn(`actor ${message.body.actorId} is missing`) | 					console.warn(`actor ${message.body.actorId} is missing`) | ||||||
| 					return | 					return | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 Sven Sauleau
						Sven Sauleau