1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! `xr restart` - connects to a running app's admin restart channel (see
//! `larust_core::__internal::admin`, which this depends on the same way
//! `dev.rs` reaches into a running/building app; it's genuinely internal
//! plumbing, not stable public API, but this crate is the one legitimate
//! consumer alongside `larust-core`'s own integration tests) and asks it
//! to perform a zero-downtime restart handoff.
//!
//! Run from within a Larust app's own directory, same convention every
//! other `xr` subcommand that operates on "the current app" already
//! uses - reads `APP_NAME` from `.env` (falling back to
//! [`crate::dev::app_name_default`], which recovers the real default the
//! *running app itself* falls back to - see that function's own doc
//! comment for why a hardcoded guess isn't good enough here) relative to
//! the current working directory, exactly as the running app itself did
//! on its own boot, which is what lets both sides compute the identical
//! admin-channel address independently. Deliberately doesn't go through
//! `larust_core::Config`/the app's own generated `config/app.rs` at
//! all - this runs in a *separate* `xr` process, outside the target
//! app's compiled binary, so it can't call a function only that binary's
//! crate defines.
use crateadmin_client;
use crateapp_name_default;
use bail;
use admin;
/// `pub(crate)` (not private) so `deploy::deploy_web`'s own restart-handoff
/// step - the last thing `xr deploy` does for `DEPLOY_TYPE=web` - can
/// interpret the exact same `ACK_HANDOFF_STARTED`/`ACK_HANDOFF_FAILED`
/// responses this reports, without duplicating the match.
pub