Vishal Gandhi
03/06/2022, 7:05 AMdart
client to populate auto schema
collection. During importJSONL
I am getting the below exception; import finishes but the number of documents is 4 times the number of lines in the JSONL
file. Typesense is running in a docker
container and the Dart client is on a remote machine. No issues with Health
API Call or creating the collection. If i remove try..catch there are 0 documents created; with try…catch 4 times number of documents in JSONL
INFO: Importing JSONL documents.
SEVERE: TimeoutException after 0:00:02.000000: Future not completed
/*documents.dart*/
Future<void> importJSONL(
Client client, [
// ignore: non_constant_identifier_names
String? JSONL,
]) async {
try {
final file = File('documents.jsonl');
logInfoln(log, 'Importing JSONL documents.');
log.fine(await client
.collection('test')
.documents
.importJSONL(JSONL ?? file.readAsStringSync()));
// await writePropagationDelay();
} on RequestException catch (e, stackTrace) {
log.severe(e.message, e, stackTrace);
} catch (e, stackTrace) {
log.severe(e, stackTrace);
}
}
/*main.dart*/
await collections.create2(client);
await documents.importJSONL(client);
Vishal Gandhi
03/06/2022, 7:27 AMconnectionTimeout
property. will update :)
final host = '<http://192.168.xxx.xxx|192.168.xxx.xxx>', protocol = Protocol.http;
final config = Configuration(
// Replace with your configur
// ation
'xxx',
nodes: {
Node(
protocol,
host,
port: 8108,
)
},
numRetries: 3, // A total of 4 tries (1 original try + 3 retries)
connectionTimeout: const Duration(seconds: 2),
Vishal Gandhi
03/06/2022, 7:31 AMconnetionTimeout
Property 🙂