Skip to content

Commit

Permalink
Merge pull request #4 from duhanbalci/fix-RPC-method-return-types
Browse files Browse the repository at this point in the history
fix ping return type
  • Loading branch information
duhanbalci committed Oct 21, 2022
2 parents ec0a8a7 + 2fc128b commit 7870b7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/src/surrealdb.dart
Expand Up @@ -33,8 +33,8 @@ class SurrealDB {
}

/// Ping SurrealDB instance
Future<bool> ping() async {
return (await _wsService.rpc('ping')) as bool;
Future<void> ping() async {
await _wsService.rpc('ping');
}

/// Switch to a specific namespace and database.
Expand Down
6 changes: 2 additions & 4 deletions lib/src/ws.dart
Expand Up @@ -50,10 +50,8 @@ class WSService {
} catch (e) {
rethrow;
}
var ping = await rpc('ping', [], Duration.zero);
if (ping == true) {
methodBus.emit('connect', {});
}
await rpc('ping', [], Duration.zero);
methodBus.emit('connect', {});
}

final _connectedCompleter = Completer<void>();
Expand Down

0 comments on commit 7870b7d

Please sign in to comment.