kopia lustrzana https://github.com/cloudflare/wildebeest
debug
rodzic
cd45aba28d
commit
7dff854773
|
@ -389,13 +389,14 @@ export async function handle(
|
|||
// move followers
|
||||
{
|
||||
const collection = await getMetadata(fromActor.followers)
|
||||
collection.items = await loadItems(collection)
|
||||
collection.items = await loadItems<string>(collection)
|
||||
|
||||
// TODO: eventually move to queue and move workers
|
||||
while (collection.items.length > 0) {
|
||||
const batch = collection.items.splice(0, 20)
|
||||
await Promise.all(
|
||||
batch.map(async (items) => {
|
||||
console.log({ items })
|
||||
await moveFollowers(db, localActor, items)
|
||||
console.log(`moved ${items.length} followers`)
|
||||
})
|
||||
|
@ -406,7 +407,7 @@ export async function handle(
|
|||
// move following
|
||||
{
|
||||
const collection = await getMetadata(fromActor.following)
|
||||
collection.items = await loadItems(collection)
|
||||
collection.items = await loadItems<string>(collection)
|
||||
|
||||
// TODO: eventually move to queue and move workers
|
||||
while (collection.items.length > 0) {
|
||||
|
|
|
@ -19,6 +19,7 @@ export async function moveFollowers(db: D1Database, actor: Actor, followers: Arr
|
|||
const actorAcc = urlToHandle(actor.id)
|
||||
|
||||
for (let i = 0; i < followers.length; i++) {
|
||||
console.log(followers[i])
|
||||
const follower = new URL(followers[i])
|
||||
const followActor = await actors.getAndCache(follower, db)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue