Skip to content

Commit

Permalink
chore: update algoliasearch
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Mar 30, 2020
1 parent eaee7e3 commit 6a0cd44
Show file tree
Hide file tree
Showing 4 changed files with 6,210 additions and 4,863 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ const algoliasearch = require('algoliasearch');
const client = algoliasearch(
process.env.ALGOLIA_APP_ID,
process.env.ALGOLIA_ADMIN_KEY, {
timeout: 4000,
timeouts: {
connect: 2,
read: 4,
write: 30
}
});
const index = client.initIndex(process.env.ALGOLIA_INDEX);
const url = 'https://c.speedtest.net/speedtest-servers-static.php';
Expand Down Expand Up @@ -87,7 +91,7 @@ const processData = (data) => {
console.log('Begin upload process...');

// Clear index first to avoid "Record quota exceeded" error for free plan
index.clearIndex((err, content) => {
index.clearObjects((err, content) => {
if (err) throw err;
console.log(`Index cleared`);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"author": "Tunghsiao Liu",
"license": "MIT",
"dependencies": {
"algoliasearch": "^3.32.1",
"algoliasearch": "^4.1.0",
"axios": "^0.19.0",
"dotenv": "^8.0.0",
"xml2js": "^0.4.19"
Expand Down
Loading

0 comments on commit 6a0cd44

Please sign in to comment.