@@ -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}
@@ -65,11 +64,6 @@ pub async fn init(config: Config) -> AtomicServerResult<AppState> {
6564 } ;
6665
6766 let should_init = !& config. store_path . exists ( ) || config. initialize ;
68- if should_init {
69- tracing:: info!( "Initialize: creating and populating new Database..." ) ;
70- atomic_lib:: populate:: populate_default_store ( & store)
71- . map_err ( |e| format ! ( "Failed to populate default store. {}" , e) ) ?;
72- }
7367
7468 // Initialize search constructs
7569 tracing:: info!( "Starting search service" ) ;
@@ -94,7 +88,9 @@ pub async fn init(config: Config) -> AtomicServerResult<AppState> {
9488 // If the user changes their server_url, the drive will not exist.
9589 // In this situation, we should re-build a new drive from scratch.
9690 if should_init {
97- atomic_lib:: populate:: populate_all ( & store) ?;
91+ tracing:: info!( "Initialize: creating and populating new Database..." ) ;
92+
93+ atomic_lib:: populate:: populate_all ( & mut store) ?;
9894 // Building the index here is needed to perform Queries on imported resources
9995 let store_clone = store. clone ( ) ;
10096 std:: thread:: spawn ( move || {
0 commit comments