healchow commented on code in PR #6846:
URL: https://github.com/apache/inlong/pull/6846#discussion_r1046581842
##########
inlong-manager/manager-web/sql/apache_inlong_manager.sql:
##########
@@ -540,6 +540,10 @@ VALUES ('admin',
'1976e096b31cfda81269d0df2775466aac6dd809e3ada1d5ba7831d85e80f1
'9B5DCE950F284141D5493A2DAFEBD1BFEECE075FC5F426E8B67F33F14876E2D0', 0,
1,
'2099-12-31 23:59:59', 'inlong_init', 'inlong_init');
+VALUES ('test_lock_account',
'1976e096b31cfda81269d0df2775466aac6dd809e3ada1d5ba7831d85e80f109',
Review Comment:
Those changes seem only needed in the test SQL file.
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/user/UserServiceImpl.java:
##########
@@ -245,4 +262,55 @@ public Boolean delete(Integer userId, String currentUser) {
return true;
}
+ /**
+ * This implementation is just to simply intercept some requests and
reduce the pressure of wrong requests on the
+ * database. The memory method used, the number of multi-node logins is
not shared, and a single node is not safe
+ * in high concurrency
+ *
+ * @param req username and pwd
+ */
+ @Override
+ public void login(UserLoginRequest req) {
+ String username = req.getUsername();
+
+ UserLoginLockStatus userLoginLockStatus =
loginLockStatusMap.get(username);
Review Comment:
Maybe change to follow is better,
```
UserLoginLockStatus userLoginLockStatus =
loginLockStatusMap.getOrDefault(username, new UserLoginLockStatus());
```
Then there is no need for `if` and `else` to check whether the
`userLoginLockStatus` is null or not because you check `lockoutTime != null` at
the following.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]