mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
don't execute fs check if the user has recent activity
The check could be expensive with some backends and is generally only required the first time that a user logs in Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -837,13 +837,16 @@ func TestTruncateQuotaLimits(t *testing.T) {
|
||||
// cleanup
|
||||
err = os.RemoveAll(user.GetHomeDir())
|
||||
assert.NoError(t, err)
|
||||
user.UsedQuotaFiles = 0
|
||||
user.UsedQuotaSize = 0
|
||||
_, err = httpdtest.UpdateQuotaUsage(user, "reset", http.StatusOK)
|
||||
assert.NoError(t, err)
|
||||
user.QuotaSize = 0
|
||||
_, _, err = httpdtest.UpdateUser(user, http.StatusOK, "")
|
||||
assert.NoError(t, err)
|
||||
if user.Username == defaultUsername {
|
||||
_, err = httpdtest.RemoveUser(user, http.StatusOK)
|
||||
assert.NoError(t, err)
|
||||
user.Password = defaultPassword
|
||||
user.QuotaSize = 0
|
||||
user.ID = 0
|
||||
user.CreatedAt = 0
|
||||
_, resp, err := httpdtest.AddUser(user, http.StatusCreated)
|
||||
assert.NoError(t, err, string(resp))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user