WIP: refactor incoming
This commit is contained in:
1 parent
691eb49009
commit
85d6d577e3
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -31,7 +31,7 @@ func (a *App) _signin(s *api.Session, w http.ResponseWriter, r *http.Request) er
|
||||
func (a *App) _signinSubmit(s *api.Session, w http.ResponseWriter, r *http.Request) error {
|
||||
host, _, _ := net.SplitHostPort(r.RemoteAddr)
|
||||
if !a.signInLock.TryLock(host) {
|
||||
time.Sleep(time.Duration(rand.Int64N(int64(4 * time.Second))))
|
||||
time.Sleep(time.Second + time.Duration(rand.Int64N(int64(3*time.Second))))
|
||||
return errs.ErrNotAuthorized
|
||||
}
|
||||
defer a.signInLock.Unlock(host)
|
||||
|
||||
Reference in new issue
Block a user