forked from engineering/cloudservices
update storage set
parent
ee95daa5ef
commit
a6c546dfed
|
@ -95,11 +95,12 @@ func handler(status* bool) {
|
||||||
func checkAccountSizeAndUpdate(username string, id string) {
|
func checkAccountSizeAndUpdate(username string, id string) {
|
||||||
var size float64 = 0
|
var size float64 = 0
|
||||||
var userHomeDirectory string = strings.Replace(strings.Join([]string{"/home/", string(username)}, ""), "\"", "", -1)
|
var userHomeDirectory string = strings.Replace(strings.Join([]string{"/home/", string(username)}, ""), "\"", "", -1)
|
||||||
|
usernameFormat := strings.Replace(username, "\"", "", -1)
|
||||||
sizeHome := DirSize(&userHomeDirectory)
|
sizeHome := DirSize(&userHomeDirectory)
|
||||||
size += sizeHome
|
size += sizeHome
|
||||||
sizeMail := DirSize(&userHomeDirectory)
|
sizeMail := DirSize(&userHomeDirectory)
|
||||||
size += sizeMail
|
size += sizeMail
|
||||||
status := RedisClient.Set("storage"+"-"+string(username), size, 0)
|
status := RedisClient.Set("storage"+"-"+usernameFormat, size, 0)
|
||||||
fmt.Println(status.Name())
|
fmt.Println(status.Name())
|
||||||
if status.Err() != nil {
|
if status.Err() != nil {
|
||||||
fmt.Println(status.Err())
|
fmt.Println(status.Err())
|
||||||
|
|
Loading…
Reference in New Issue