fixed "missing test.db" error
This commit is contained in:
parent
699391bbfb
commit
827d3052c9
1 changed files with 3 additions and 2 deletions
|
@ -18,10 +18,11 @@ func SetLogLevel(level zerolog.Level) {
|
|||
|
||||
func Init_testdb(DB_TYPE string, DB_CONNECTION_STRING string) {
|
||||
|
||||
cwd, err := os.Getwd()
|
||||
cwd, err := os.Getwd();
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Could not get current working directory")
|
||||
} else {
|
||||
cwd = cwd + "/";
|
||||
log.Trace().Msgf("Currect working directory is: %s", cwd)
|
||||
}
|
||||
|
||||
|
@ -30,7 +31,7 @@ func Init_testdb(DB_TYPE string, DB_CONNECTION_STRING string) {
|
|||
log.Debug().Msg("Found existing test.db file. Attempting to delete")
|
||||
err = os.Remove(DB_CONNECTION_STRING)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Failed to delete testing db")
|
||||
log.Warn().Err(err).Msg("Failed to delete testing db. Continueing anyways")
|
||||
} else {
|
||||
log.Debug().Msg("Deleted test.db file successfully")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue