gatsby-source-notion-database
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -0,0 +0,0 @@ const Notabase = require("notabase") |
{ | ||
"name": "gatsby-source-notion-database", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Load data from Notion's database", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ # gatsby-source-notion-database |
@@ -73,14 +73,10 @@ const getPageHtml = require('./getPageHtml') | ||
if (cachedData) { | ||
console.log(`get html from cache: ${tableName} - ${itemData.id}`) | ||
data.html = cachedData.html | ||
} else { | ||
console.log(`get html from notion: ${tableName} - ${itemData.id}`) | ||
let url = `https://notion.so/${itemData.id.split('-').join('')}` | ||
let html | ||
try { | ||
html = await getPageHtml(url) | ||
data.html = html | ||
updateCacheData(data) | ||
} catch (error) { | ||
html = 'error' | ||
data.html = html | ||
} | ||
let html = await getPageHtml(url) | ||
data.html = html | ||
updateCacheData(data) | ||
} | ||
@@ -87,0 +83,0 @@ } |
const puppeteer = require('puppeteer'); | ||
process.setMaxListeners(0) | ||
const getPageHtml = async (url) => { | ||
@@ -55,3 +55,3 @@ const browser = await puppeteer.launch(); | ||
else { | ||
return false | ||
return 'error' | ||
} | ||
@@ -58,0 +58,0 @@ }) |
Sorry, the diff of this file is not supported yet
22959
10
179