Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local file system storage as default #4386

Merged

Conversation

dennisreimann
Copy link
Member

Checks whether or not a file storage has been set. If not, it sets the local file system storage as default.

Checks whether or not a file storage has been set. If not, it sets the local file system storage as default.
Comment on lines -38 to +46
DirectoryInfo dirInfo;
if (!Directory.Exists(datadirs.Value.StorageDir))
{
dirInfo = Directory.CreateDirectory(datadirs.Value.StorageDir);
}
else
{
dirInfo = new DirectoryInfo(datadirs.Value.StorageDir);
}
var dirInfo = Directory.Exists(datadirs.Value.StorageDir)
? new DirectoryInfo(datadirs.Value.StorageDir)
: Directory.CreateDirectory(datadirs.Value.StorageDir);

if (!Directory.Exists(datadirs.Value.TempDir))
{
Directory.CreateDirectory(datadirs.Value.TempDir);
}

DirectoryInfo tmpdirInfo;
if (!Directory.Exists(datadirs.Value.TempStorageDir))
{
tmpdirInfo = Directory.CreateDirectory(datadirs.Value.TempStorageDir);
}
else
{
tmpdirInfo = new DirectoryInfo(datadirs.Value.TempStorageDir);
}
var tmpdirInfo = Directory.Exists(datadirs.Value.TempStorageDir)
? new DirectoryInfo(datadirs.Value.TempStorageDir)
: Directory.CreateDirectory(datadirs.Value.TempStorageDir);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just simplifications of the existing code.

@pavlenex
Copy link
Contributor

Concept ack.

@NicolasDorier
Copy link
Member

The PR is migrating current installs to use file storage provider.
However, it isn't putting the file storage provider for new instances. The migrations don't run for new installs.

@dennisreimann
Copy link
Member Author

@NicolasDorier Updated as discussed.

@dstrukt dstrukt self-requested a review December 4, 2022 09:00
Copy link
Member

@dstrukt dstrukt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK!

@dstrukt dstrukt mentioned this pull request Dec 4, 2022
@NicolasDorier NicolasDorier merged commit f2cb07a into btcpayserver:master Dec 12, 2022
@dennisreimann dennisreimann deleted the filesystemstorage-default branch December 12, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants