Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support manually triggering a page reload from an external process #29

Open
nogweii opened this issue Dec 5, 2023 · 1 comment
Open

Comments

@nogweii
Copy link

nogweii commented Dec 5, 2023

I am running guard on my laptop. It is monitoring changes to the files underneath config/ & lib/, and causes the whole server to restart.

I'd like to have the page reload after the server is restarted, but I'm not sure how to trigger that from something outside the rails process. Here was my first attempt at it:

require "socket"
require "json"

command = {
  "event" => "reload",
  "files" => ["app/assets/builds/application.js"]
}

socket = UNIXSocket.new("tmp/sockets/rails_live_reload.sock")
socket.puts command.to_json
@manastyretskyi
Copy link
Contributor

Hello @nogweii, sorry for taking a lot of time to reply.

I don't think it is possible to do at the moment, for this, Unix server has to be updated here so that it will be able to receive commands from connections, as right now it can only "transmit" commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants