1- use std:: {
2- collections:: HashSet ,
3- future:: Future ,
4- path:: { Path , PathBuf } ,
5- pin:: Pin ,
6- } ;
1+ use std:: { collections:: HashSet , future:: Future , path:: Path , pin:: Pin } ;
72
83use log:: info;
94use spin_app:: { locked:: LockedApp , App } ;
@@ -19,7 +14,7 @@ use trigger_command::CommandTrigger;
1914use trigger_mqtt:: MqttTrigger ;
2015use trigger_sqs:: SqsTrigger ;
2116
22- use crate :: constants:: { RUNTIME_CONFIG_PATH , SPIN_DEFAULT_STATE_DIR , SPIN_TRIGGER_WORKING_DIR } ;
17+ use crate :: constants:: { RUNTIME_CONFIG_PATH , SPIN_TRIGGER_WORKING_DIR } ;
2318
2419pub ( crate ) const HTTP_TRIGGER_TYPE : & str = <HttpTrigger as Trigger < TriggerFactors > >:: TYPE ;
2520pub ( crate ) const REDIS_TRIGGER_TYPE : & str = <RedisTrigger as Trigger < TriggerFactors > >:: TYPE ;
@@ -54,11 +49,12 @@ fn factors_config() -> FactorsConfig {
5449 . then ( || RUNTIME_CONFIG_PATH . into ( ) ) ;
5550 // Configure the application state directory path. This is used in the default
5651 // locations for logs, key value stores, etc.
57- let state_dir = PathBuf :: from ( SPIN_TRIGGER_WORKING_DIR ) . join ( SPIN_DEFAULT_STATE_DIR ) ;
5852 FactorsConfig {
5953 working_dir : SPIN_TRIGGER_WORKING_DIR . into ( ) ,
6054 runtime_config_file,
61- state_dir : UserProvidedPath :: Provided ( state_dir) ,
55+ // This is the default base for the state_dir (.spin) unless it is
56+ // explicitly configured via the runtime config.
57+ local_app_dir : Some ( SPIN_TRIGGER_WORKING_DIR . to_string ( ) ) ,
6258 // Explicitly do not set log dir in order to force logs to be displayed to stdout.
6359 // Otherwise, would default to the state directory.
6460 log_dir : UserProvidedPath :: Unset ,
0 commit comments