Skip to content

Commit 606f918

Browse files
committed
site_metadata: Expose read_only field
1 parent e41f2a4 commit 606f918

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/controllers/site_metadata.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ use super::prelude::*;
55
/// The sha is contained within the `HEROKU_SLUG_COMMIT` environment variable.
66
/// If `HEROKU_SLUG_COMMIT` is not set, returns `"unknown"`.
77
pub fn show_deployed_sha(req: &mut dyn RequestExt) -> EndpointResult {
8+
let config = &req.app().config;
9+
let read_only = config.db.are_all_read_only();
10+
811
let deployed_sha =
912
dotenv::var("HEROKU_SLUG_COMMIT").unwrap_or_else(|_| String::from("unknown"));
1013

1114
Ok(req.json(&json!({
1215
"deployed_sha": &deployed_sha[..],
1316
"commit": &deployed_sha[..],
17+
"read_only": read_only,
1418
})))
1519
}

0 commit comments

Comments
 (0)