Skip to content

Application with remote_repository_url -> delete content folder while the application is running -> repo is pulled again, but FileWatcher stops watching #50

Description

@alfredbaudisch

This is a very low priority corner case, because the root_path folder is not supposed to be deleted at runtime anyway.

Also, probably just under Windows.

How to Reproduce

  • Application which has content from a Git repository ( remote_repository_url)
  • Start the application and wait for the first Git pull into root_path
  • Now delete the physical root_path folder
  • Wait for the next Git fetch
  • The root_path folder is created again and the content is pulled into it
  • FileWatcher does not watch for changes anymore, it just hangs?

Report

  • OS: Windows 10
iex(1)> 09:32:29.425 [info][mfa=PardallMarkdown.RepositoryProviders.Git.fetch/1 ] Fetching data from https://github.com/alfredbaudisch/pardall_markdown_sample_content
iex(1)> 09:32:29.432 [error][mfa=:gen_server.error_info/7 ] GenServer #PID<0.297.0> terminating
** (stop) :eacces
    erlang.erl:4412: :erlang.open_port({:spawn_executable, 'c:/Program Files/Git/mingw64/bin/git.exe'}, [{:cd, "p:/Dev/webdev/elixir/projects/pardall_markdown/sample_content"}, :stderr_to_stdout, :use_stdio, :exit_status, :binary, :hide, {:args, ["fetch"]}])
    (elixir 1.12.2) lib/system.ex:1052: System.do_cmd/3
    (git_cli 0.3.0) lib/git.ex:105: Git.execute_command/4
    (pardall_markdown 0.4.0) lib/pardall_markdown/repository_providers/git.ex:43: PardallMarkdown.RepositoryProviders.Git.fetch/1
    (pardall_markdown 0.4.0) lib/repository_watcher.ex:30: PardallMarkdown.RepositoryWatcher.handle_info/2
    (stdlib 3.15) gen_server.erl:695: :gen_server.try_dispatch/4
    (stdlib 3.15) gen_server.erl:771: :gen_server.handle_msg/6
    (stdlib 3.15) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: :check_pending_remote_events
State: %PardallMarkdown.RepositoryProvider{provider: [provider: "https://github.com/alfredbaudisch/pardall_markdown_sample_content"], repo: %Git.Repository{path: "p:/Dev/webdev/elixir/projects/pardall_markdown/sample_content"}}
iex(1)> 09:32:30.313 [info][mfa=PardallMarkdown.RepositoryProviders.Git.git_repository/0 ] Cloning repository https://github.com/alfredbaudisch/pardall_markdown_sample_content, into ./sample_content
iex(1)> 09:32:30.836 [info][mfa=PardallMarkdown.RepositoryProviders.Git.repository/0 ] Pulling from git repository Already up to date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions