@@ -79,19 +79,9 @@ pub fn run(args: &ServeArgs) -> anyhow::Result<()> {
7979 ) ;
8080 }
8181
82- // Check backend is supported by this build
82+ // Validate backend is supported and get catalog version (fail fast before binding port)
8383 let backend = & app_config. storage . _backend ;
84- #[ cfg( not( feature = "postgres" ) ) ]
85- if backend == "postgres" {
86- anyhow:: bail!( "PostgreSQL backend not enabled. Rebuild with --features postgres" ) ;
87- }
88- #[ cfg( feature = "postgres" ) ]
89- if backend != "postgres" {
90- anyhow:: bail!(
91- "Unknown backend '{}'. This build only supports 'postgres'." ,
92- backend
93- ) ;
94- }
84+ let catalog_version = extenddb_storage:: operations:: catalog_version ( backend) ?;
9585
9686 let port = args. port . unwrap_or ( app_config. server . port ) ;
9787 let bind_addr = format ! ( "{}:{}" , app_config. server. bind_addr, port) ;
@@ -112,9 +102,6 @@ pub fn run(args: &ServeArgs) -> anyhow::Result<()> {
112102 // it to stderr so a process supervisor receives banner and tracing logs
113103 // on the same stream — mixing stdout and stderr makes container log
114104 // capture noisier than necessary.
115- let backend = & app_config. storage . _backend ;
116- let catalog_version = extenddb_storage:: operations:: catalog_version ( backend)
117- . unwrap_or_else ( |_| "unknown" . to_string ( ) ) ;
118105 let banner_line1 = format ! (
119106 "extenddb {} (catalog {}) starting on {}" ,
120107 env!( "CARGO_PKG_VERSION" ) ,
0 commit comments