mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
update following task handler url
This commit is contained in:
parent
12c18a3661
commit
5057448c4f
2 changed files with 9 additions and 7 deletions
|
|
@ -5,11 +5,7 @@ import * as dotenv from 'dotenv' // see https://github.com/motdotla/dotenv#how-d
|
|||
import * as jwt from 'jsonwebtoken'
|
||||
import Parser, { Item } from 'rss-parser'
|
||||
import { promisify } from 'util'
|
||||
import {
|
||||
CONTENT_FETCH_URL,
|
||||
createCloudTask,
|
||||
FOLLOWING_HANDLER_URL,
|
||||
} from './task'
|
||||
import { CONTENT_FETCH_URL, createCloudTask } from './task'
|
||||
|
||||
interface RssFeedRequest {
|
||||
subscriptionIds: string[]
|
||||
|
|
@ -189,8 +185,15 @@ const createFollowingTask = async (
|
|||
|
||||
try {
|
||||
console.log('Creating task', input.url)
|
||||
const apiEndpoint = process.env.REST_BACKEND_ENDPOINT
|
||||
const token = process.env.PUBSUB_VERIFICATION_TOKEN
|
||||
if (!apiEndpoint || !token) {
|
||||
throw 'Environment not configured correctly'
|
||||
}
|
||||
|
||||
// save page
|
||||
const task = await createCloudTask(FOLLOWING_HANDLER_URL, input)
|
||||
const taskHandlerUrl = `${apiEndpoint}/svc/following/save?token=${token}`
|
||||
const task = await createCloudTask(taskHandlerUrl, input)
|
||||
console.log('Created task', task)
|
||||
|
||||
return !!task
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import { CloudTasksClient, protos } from '@google-cloud/tasks'
|
|||
const cloudTask = new CloudTasksClient()
|
||||
|
||||
export const CONTENT_FETCH_URL = process.env.CONTENT_FETCH_GCF_URL
|
||||
export const FOLLOWING_HANDLER_URL = process.env.FOLLOWING_HANDLER_URL
|
||||
|
||||
export const createCloudTask = async (
|
||||
taskHandlerUrl: string | undefined,
|
||||
|
|
|
|||
Loading…
Reference in a new issue