add support for delayed quota update

If there are a lot of close uploads, accumulating quota updates can
save you many queries to the data provider
This commit is contained in:
Nicola Murino
2021-04-11 08:38:43 +02:00
parent 4b98f37df1
commit c844fc7477
9 changed files with 324 additions and 12 deletions

View File

@@ -17,6 +17,7 @@ import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/jwtauth/v5"
"github.com/lestrrat-go/jwx/jwa"
"github.com/drakkan/sftpgo/common"
"github.com/drakkan/sftpgo/dataprovider"
@@ -250,7 +251,7 @@ func (c *Conf) Initialize(configDir string) error {
certMgr = mgr
}
csrfTokenAuth = jwtauth.New("HS256", utils.GenerateRandomBytes(32), nil)
csrfTokenAuth = jwtauth.New(jwa.HS256.String(), utils.GenerateRandomBytes(32), nil)
exitChannel := make(chan error, 1)