kopia lustrzana https://github.com/fediversespace/fediverse.space
fix crawls of well-connected instances
rodzic
b7cb7fa685
commit
4d4193ff49
|
@ -35,7 +35,7 @@ jobs:
|
||||||
- name: Build & push
|
- name: Build & push
|
||||||
uses: depot/build-push-action@v1
|
uses: depot/build-push-action@v1
|
||||||
with:
|
with:
|
||||||
project: 3tz1wxj8cr
|
project: rktsv8c4sk
|
||||||
context: backend
|
context: backend
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
|
|
@ -5,6 +5,7 @@ data/
|
||||||
*.class
|
*.class
|
||||||
|
|
||||||
backend/.sobelow
|
backend/.sobelow
|
||||||
|
node_modules/
|
||||||
|
|
||||||
# Environments
|
# Environments
|
||||||
.env
|
.env
|
||||||
|
|
|
@ -235,9 +235,12 @@ defmodule Backend.Crawler do
|
||||||
Enum.map(result.federation_restrictions, fn {domain, _restriction_type} -> domain end)
|
Enum.map(result.federation_restrictions, fn {domain, _restriction_type} -> domain end)
|
||||||
)
|
)
|
||||||
|> Enum.map(&%{domain: &1, inserted_at: now, updated_at: now, next_crawl: now})
|
|> Enum.map(&%{domain: &1, inserted_at: now, updated_at: now, next_crawl: now})
|
||||||
|
|> Enum.chunk_every(5000)
|
||||||
|
|
||||||
Instance
|
new_instances
|
||||||
|> Repo.insert_all(new_instances, on_conflict: :nothing, conflict_target: :domain)
|
|> Enum.each(fn chunk ->
|
||||||
|
Repo.insert_all(Instance, chunk, on_conflict: :nothing, conflict_target: :domain)
|
||||||
|
end)
|
||||||
|
|
||||||
Repo.transaction(fn ->
|
Repo.transaction(fn ->
|
||||||
## Save peer relationships ##
|
## Save peer relationships ##
|
||||||
|
@ -274,9 +277,10 @@ defmodule Backend.Crawler do
|
||||||
updated_at: now
|
updated_at: now
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|> Enum.chunk_every(5000)
|
||||||
|
|
||||||
InstancePeer
|
new_instance_peers
|
||||||
|> Repo.insert_all(new_instance_peers)
|
|> Enum.each(fn chunk -> Repo.insert_all(InstancePeer, chunk) end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
## Save federation restrictions ##
|
## Save federation restrictions ##
|
||||||
|
|
Ładowanie…
Reference in New Issue