fix(files): cleanups

This commit is contained in:
hexxa 2021-08-20 22:39:21 +08:00 committed by Hexxa
parent c864c2bcb5
commit 2b55d5c159
2 changed files with 5 additions and 4 deletions

View file

@ -109,7 +109,8 @@ func (h *FileHandlers) canAccess(userName, role, op, path string) bool {
} }
// TODO: improve performance // TODO: improve performance
for i := 1; i <= len(parts); i++ { for i := 1; i <= len(parts); i++ {
_, ok := h.deps.FileInfos().GetSharing(strings.Join(parts[0:i], "/")) prefix := strings.Join(parts[0:i], "/")
_, ok := h.deps.FileInfos().GetSharing(prefix)
if ok { if ok {
return true return true
} }

View file

@ -73,7 +73,7 @@ func DefaultConfig() (string, error) {
CaptchaEnabled: true, CaptchaEnabled: true,
UploadSpeedLimit: 100 * 1024, // B UploadSpeedLimit: 100 * 1024, // B
DownloadSpeedLimit: 100 * 1024, // B DownloadSpeedLimit: 100 * 1024, // B
SpaceLimit: 1024, // GB SpaceLimit: 1024 * 1024 * 100, // 100MB
LimiterCapacity: 1000, LimiterCapacity: 1000,
LimiterCyc: 1000, // 1s LimiterCyc: 1000, // 1s
}, },