Made the storage service make the user folders
Signed-off-by: arzumify <jliwin98@danwin1210.de>
This commit is contained in:
parent
34a3580ec6
commit
48547833e4
|
@ -153,8 +153,17 @@ func getQuota(userID uuid.UUID) (int64, error) {
|
||||||
|
|
||||||
func getUsed(userID uuid.UUID, information library.ServiceInitializationInformation) (int64, error) {
|
func getUsed(userID uuid.UUID, information library.ServiceInitializationInformation) (int64, error) {
|
||||||
// Get the used space for a user by first getting the reserved space from file storage
|
// Get the used space for a user by first getting the reserved space from file storage
|
||||||
|
_, err := os.Stat(filepath.Join(information.Configuration["path"].(string), userID.String()))
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
// Create the directory
|
||||||
|
err = os.Mkdir(filepath.Join(information.Configuration["path"].(string), userID.String()), 0755)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var used int64
|
var used int64
|
||||||
err := filepath.Walk(filepath.Join(information.Configuration["path"].(string), userID.String()), func(path string, entry os.FileInfo, err error) error {
|
err = filepath.Walk(filepath.Join(information.Configuration["path"].(string), userID.String()), func(path string, entry os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue