@@ -29,11 +29,10 @@ pub struct AppState {
2929
3030/// Initializes the Store and sets the default agent.
3131pub fn init_store ( config : & Config ) -> AtomicServerResult < Db > {
32- let mut store = atomic_lib:: Db :: init ( & config. store_path , & config. server_url ) ?;
32+ let store = atomic_lib:: Db :: init ( & config. store_path , & config. server_url ) ?;
3333
3434 tracing:: info!( "Setting default agent" ) ;
3535 set_default_agent ( config, & store) ?;
36- store. register_default_endpoints ( ) ?;
3736
3837 Ok ( store)
3938}
@@ -66,11 +65,6 @@ pub async fn init(config: Config) -> AtomicServerResult<AppState> {
6665 } ;
6766
6867 let should_init = !& config. store_path . exists ( ) || config. initialize ;
69- if should_init {
70- tracing:: info!( "Initialize: creating and populating new Database..." ) ;
71- atomic_lib:: populate:: populate_default_store ( & store)
72- . map_err ( |e| format ! ( "Failed to populate default store. {}" , e) ) ?;
73- }
7468
7569 // Initialize search constructs
7670 tracing:: info!( "Starting search service" ) ;
@@ -95,7 +89,9 @@ pub async fn init(config: Config) -> AtomicServerResult<AppState> {
9589 // If the user changes their server_url, the drive will not exist.
9690 // In this situation, we should re-build a new drive from scratch.
9791 if should_init {
98- atomic_lib:: populate:: populate_all ( & store) ?;
92+ tracing:: info!( "Initialize: creating and populating new Database..." ) ;
93+
94+ atomic_lib:: populate:: populate_all ( & mut store) ?;
9995 // Building the index here is needed to perform Queries on imported resources
10096 let store_clone = store. clone ( ) ;
10197 std:: thread:: spawn ( move || {
0 commit comments