Compare commits
No commits in common. "6d9db86e30f6e73cbc0929926bc45c626c2d25d0" and "52613685143a7f0cf14e4ca9e444e29963eebdf7" have entirely different histories.
6d9db86e30
...
5261368514
2 changed files with 3 additions and 20 deletions
|
@ -1,15 +0,0 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest-amd64
|
||||
|
||||
uses: daniel/reusable-workflows/.github/workflows/nix-flake-build.yaml@main
|
||||
with:
|
||||
runner: ubuntu-latest-amd64
|
||||
secrets: inherit
|
|
@ -144,12 +144,10 @@ defmodule BdfrBrowser.Importer do
|
|||
|
||||
@impl true
|
||||
def handle_cast(:background_import, %State{last_import: last_import} = state) do
|
||||
current_time = System.os_time(:second)
|
||||
|
||||
_ = subreddits()
|
||||
_ = posts_and_comments(last_import)
|
||||
_ = chats()
|
||||
{:noreply, %State{state | last_import: current_time}}
|
||||
{:noreply, %State{state | last_import: System.os_time(:second)}}
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
@ -312,7 +310,7 @@ defmodule BdfrBrowser.Importer do
|
|||
|
||||
defp import_post(post, subreddit) when not is_nil(subreddit) do
|
||||
id = post["id"]
|
||||
db_post = Repo.get(Post, id)
|
||||
db_post = id |> Post.get_import() |> Repo.one()
|
||||
|
||||
if is_nil(db_post) do
|
||||
%Post{
|
||||
|
@ -335,7 +333,7 @@ defmodule BdfrBrowser.Importer do
|
|||
|
||||
defp import_comment(comment, post, parent) when not is_nil(post) do
|
||||
id = comment["id"]
|
||||
db_comment = Repo.get(Comment, id)
|
||||
db_comment = id |> Comment.get_import() |> Repo.one()
|
||||
|
||||
{:ok, parent} =
|
||||
if is_nil(db_comment) do
|
||||
|
|
Reference in a new issue