MM-20913 add client API Client.GetServerBusy to fetch server busy state and timeout. (#13986)
* MM-20913 add client API to fetch server busy state and timeout * deprecate current API that only returns timeout * required for mmctl MM-20913 * restore deleted unit test for GetServerBusyExpires Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -4752,8 +4752,23 @@ func (c *Client4) ClearServerBusy() (bool, *Response) {
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
// GetServerBusy returns the current ServerBusyState including the time when a server marked busy
|
||||
// will automatically have the flag cleared.
|
||||
func (c *Client4) GetServerBusy() (*ServerBusyState, *Response) {
|
||||
r, err := c.DoApiGet(c.GetServerBusyRoute(), "")
|
||||
if err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
sbs := ServerBusyStateFromJson(r.Body)
|
||||
return sbs, BuildResponse(r)
|
||||
}
|
||||
|
||||
// GetServerBusyExpires returns the time when a server marked busy
|
||||
// will automatically have the flag cleared.
|
||||
//
|
||||
// Deprecated: Use GetServerBusy instead.
|
||||
func (c *Client4) GetServerBusyExpires() (*time.Time, *Response) {
|
||||
r, err := c.DoApiGet(c.GetServerBusyRoute(), "")
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user