mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
Scraping Fixes
- Fixed bugs with scraping graphql endpoint - Added traceID to logging for jobs
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ class Context {
|
||||
this.id = ctx.id || uuid.v4();
|
||||
|
||||
// Attach a logger or create one.
|
||||
this.log = ctx.log || createLogger('context', this.id);
|
||||
this.log = ctx.log || createLogger('graph:context', this.id);
|
||||
|
||||
// Load the current logged in user to `user`, otherwise this will be null.
|
||||
this.user = get(ctx, 'user');
|
||||
|
||||
@@ -119,7 +119,7 @@ const findOrCreateAssetByURL = async (ctx, url) => {
|
||||
// If this is a new asset, then we need to scrape it!
|
||||
if (!asset.scraped) {
|
||||
// Create the Scraper job.
|
||||
await Scraper.create(asset);
|
||||
await Scraper.create(ctx, asset.id);
|
||||
}
|
||||
|
||||
return asset;
|
||||
|
||||
@@ -63,9 +63,9 @@ const closeNow = async (ctx, id) =>
|
||||
* @param {String} id the asset's id to scrape
|
||||
*/
|
||||
const scrapeAsset = async (ctx, id) => {
|
||||
const { services: { Scraper } } = ctx;
|
||||
const { connectors: { services: { Scraper } } } = ctx;
|
||||
|
||||
return Scraper.create({ id });
|
||||
return Scraper.create(ctx, id);
|
||||
};
|
||||
|
||||
module.exports = ctx => {
|
||||
|
||||
Reference in New Issue
Block a user