File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -6,5 +6,4 @@ const client = new MeiliSearch({
66 apiKey : 'masterKey' ,
77} )
88await client . index ( 'steam-video-games' ) . delete ( )
9- const task = await client . index ( 'steam-video-games' ) . addDocuments ( games )
10- await client . waitForTask ( task . taskUid )
9+ client . index ( 'steam-video-games' ) . addDocuments ( games ) . waitTask ( )
Original file line number Diff line number Diff line change @@ -22,10 +22,11 @@ await gamesIndex.updateSettings({
2222 sortableAttributes : [ 'recommendationCount' ] ,
2323} )
2424
25- const moviesRes = await moviesIndex . addDocuments ( movies )
26- const gamesRes = await gamesIndex . addDocuments ( games )
25+ const moviesTask = await moviesIndex . addDocuments ( movies )
26+ const gamesTask = await gamesIndex . addDocuments ( games )
27+
28+ await moviesTask . waitTask ( )
29+ await gamesTask . waitTask ( )
2730
28- const moviesTask = await client . waitForTask ( moviesRes . taskUid )
29- const gamesTask = await client . waitForTask ( gamesRes . taskUid )
3031console . log ( moviesTask )
3132console . log ( gamesTask )
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ const msClient = new MeiliSearch({
1212} )
1313
1414try {
15- const task1 = await msClient . index ( 'node_test' ) . addDocuments ( [ ] )
16- await msClient . waitForTask ( task1 . taskUid )
15+ await msClient . index ( 'node_test' ) . addDocuments ( [ ] ) . waitTask ( )
1716 await searchClient . search ( [
1817 {
1918 indexName : 'node_test' ,
2322 } ,
2423 ] )
2524
26- const task2 = await msClient . index ( 'node_test' ) . delete ( )
27- await msClient . waitForTask ( task2 . taskUid )
25+ await msClient . index ( 'node_test' ) . delete ( ) . waitTask ( )
2826 process . exit ( 0 )
2927} catch ( e ) {
3028 console . log ( e )
You can’t perform that action at this time.
0 commit comments