mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-16 10:53:48 +00:00
Refactored environmental functions
This commit is contained in:
3 files changed
+8
-8
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
pub fn is_dev() -> bool {
|
||||||
|
cfg!(debug_assertions)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_prod() -> bool {
|
||||||
|
!is_dev()
|
||||||
|
}
|
||||||
@@ -1 +1,2 @@
|
|||||||
pub mod encryption;
|
pub mod encryption;
|
||||||
|
pub mod environment;
|
||||||
@@ -640,14 +640,6 @@ async fn dotnet_ready(_token: APIToken) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_dev() -> bool {
|
|
||||||
cfg!(debug_assertions)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_prod() -> bool {
|
|
||||||
!is_dev()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_available_port() -> Option<u16> {
|
fn get_available_port() -> Option<u16> {
|
||||||
TcpListener::bind(("127.0.0.1", 0))
|
TcpListener::bind(("127.0.0.1", 0))
|
||||||
.map(|listener| listener.local_addr().unwrap().port())
|
.map(|listener| listener.local_addr().unwrap().port())
|
||||||
|
|||||||
Reference in new issue
Block a user