Commit Graph

8 Commits

Author SHA1 Message Date
Martin Brennan 3802d0de9d
DEV: Further refine development reload for plugin files (#22141)
Followup f3afc8bf85 to better
exclude all spec files including PageObject files.
2023-06-16 16:15:15 +08:00
Martin Brennan f3afc8bf85
DEV: Do not auto reload on plugin spec file changes (#22127)
There is no need to reload the rails server if plugin spec
files change, since they are not autoloaded but they are also
not loaded into the app.
2023-06-15 16:34:30 +10:00
Martin Brennan 7a593e2fb5
DEV: Use internal __autoloads for zeitwork reload check (#20260)
Since ad6c028484
in the zeitwork repo which was introduced to discourse/discourse in PR #20253,
the `autoloads` attribute on the loader has been marked `internal`, which means
that it errors if we try to access it directly.

Instead we should access it via the "mangled" version so it is clear
we're accessing an internal property, which is `__autoloads`.

Without this, any time a ruby file is saved the
000-development_reload_warnings.rb initializer will error.
2023-02-13 16:26:40 +10:00
David Taylor 7c77cc6a58
DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
Jarek Radosz 5a50f18c0c
DEV: Avoid `$` globals (#15453)
Also:
* Remove an unused method (#fill_email)
* Replace a method that was used just once (#generate_username) with `SecureRandom.alphanumeric`
* Remove an obsolete dev puma `tmp/restart` file logic
2022-01-08 23:39:46 +01:00
David Taylor b6b27bc383
DEV: Improve auto-restart parent process detection logic (#13068)
The auto restart logic was sending a USR2 to the parent process without checking what the parent process actually was. In some situations, it might not be the `bin/unicorn` supervisor.

This commit switches to use a global variable for the supervisor PID. This will be much less prone to unexpected behavior.
2021-05-14 18:17:31 +01:00
Gerhard Schlager d6b53b688d
DEV: Prevent automatic restart of rails console (and crashing zsh) (#13066)
Only a server should be restarted when non-autoloaded ruby files are edited.
2021-05-14 18:19:22 +02:00
David Taylor b65af1193d
DEV: Print a warning and restart server when editing non-autoloaded files (#13037)
This commit adds a listener on (almost) all `.rb` files in the repository. When a change occurs, it checks whether Zeitwerk is responsible for autoloading it. If not, a warning will be printed to the console and the server will be automatically restarted. Optionally, you can pass the `AUTO_RESTART=0` environment variable to prevent auto-restart.
2021-05-12 10:32:45 +01:00