New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No errors thrown when the worker is down #206
Comments
There is already a timeout mechanism on requests to ZetaPush platform. const client = new ZetaPushClient.WeakClient();
const api = client.createProxyTaskService();
await client.connect();
console.log('connected'); // Will work even if worker is not started
try {
const message = await api.hello();
} catch (error) {
// This code will fail if worker is not started after a 10s timeout
} Timeout is configurable via createProxyTaskService const api = client.createProxyTaskService({
timeout: 1000
}); |
Doesn't seem to work for me with the user-management... export default class UserManagementAsyncTaskService extends Queue {
signup(p, ns) {
return this.$publish('signup', p, ns);
}
}
const client = new ZetaPushClient.WeakClient();
const api = client.createAsyncTaskService({ Type: UserManagementAsyncTaskService, namespace: 'user' });
await client.connect();
try {
await api.signup({
credentials: { login: email, password },
profile: {
email,
},
});
} catch(error) {
// Never called
} |
|
I'm submitting a ... (check one with "x")
Scope (check one with "x")
Current behavior
When the local worker is not running, no connection error is thrown on a user management method. The promise doesn't seem to end at all. Impossible to handle the case where the servers are unavailable. However, a client can establish a connection even if there is no worker. It's a little weird because I'm allowed to be connected with ZetaPush but I can't use the user-management.
Expected behavior
Put a timeout on the API method to throw an exception (maybe PlatformError ?) when the servers are not available and maybe not allow the connection if the worker is not running.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Handle the case where the servers are down
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: