MXS-1539: Add asynchronous authenticator capability
The new ACAP_TYPE_ASYNC capability allows the authenticator to tell the core that all entry points for it support asynchronous usage.
This commit is contained in:
@ -1621,6 +1621,11 @@ int service_refresh_users(SERVICE *service)
|
||||
ss_dassert(self >= 0);
|
||||
time_t now = time(NULL);
|
||||
|
||||
if ((service->capabilities & ACAP_TYPE_ASYNC) == 0)
|
||||
{
|
||||
spinlock_acquire(&service->spin);
|
||||
}
|
||||
|
||||
/* Check if refresh rate limit has been exceeded */
|
||||
if ((now < service->rate_limits[self].last + USERS_REFRESH_TIME) ||
|
||||
(service->rate_limits[self].nloads >= USERS_REFRESH_MAX_PER_TIME))
|
||||
@ -1669,6 +1674,11 @@ int service_refresh_users(SERVICE *service)
|
||||
}
|
||||
}
|
||||
|
||||
if ((service->capabilities & ACAP_TYPE_ASYNC) == 0)
|
||||
{
|
||||
spinlock_release(&service->spin);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
MXS_AUTHENTICATOR_VERSION,
|
||||
"The MySQL client to MaxScale authenticator implementation",
|
||||
"V1.1.0",
|
||||
MXS_NO_MODULE_CAPABILITIES,
|
||||
ACAP_TYPE_ASYNC,
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
|
Reference in New Issue
Block a user