MCPcopy Index your code
hub / github.com/simstudioai/sim / updateRssState

Function updateRssState

apps/sim/lib/webhooks/polling/rss.ts:161–183  ·  view source on GitHub ↗
(
  webhookId: string,
  timestamp: string,
  newGuids: string[],
  config: RssWebhookConfig,
  logger: Logger,
  etag?: string,
  lastModified?: string
)

Source from the content-addressed store, hash-verified

159}
160
161async function updateRssState(
162 webhookId: string,
163 timestamp: string,
164 newGuids: string[],
165 config: RssWebhookConfig,
166 logger: Logger,
167 etag?: string,
168 lastModified?: string
169) {
170 const existingGuids = config.lastSeenGuids || []
171 const allGuids = [...newGuids, ...existingGuids].slice(0, MAX_GUIDS_TO_TRACK)
172
173 await updateWebhookProviderConfig(
174 webhookId,
175 {
176 lastCheckedTimestamp: timestamp,
177 lastSeenGuids: allGuids,
178 ...(etag !== undefined ? { etag } : {}),
179 ...(lastModified !== undefined ? { lastModified } : {}),
180 },
181 logger
182 )
183}
184
185async function fetchNewRssItems(
186 config: RssWebhookConfig,

Callers 1

pollWebhookFunction · 0.85

Calls 1

Tested by

no test coverage detected