Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async updateFeeds(modification) {
let now = Date.now(),
prevDate = 0
this.modification = modification
if (this.siteObj.runtime && this.siteObj.runtime.feeds && this.siteObj.runtime.feeds.last_refresh > now - this.interval.recrawl) { // Still not needed to refresh
if (!this.siteObj.runtime.feeds.last_check || this.siteObj.runtime.feeds.last_check < now - this.interval.check) { // Add New feeds only
prevDate = this.siteObj.runtime.feeds.last_check // Save previous checking date for site database querying
signale.note(`Checking feeds for ${this.address}, date after ${prevDate}`)
modification.runtime.feeds.last_check = now
} else {
signale.note(`Stored feeds are up to date ${this.address}`)
return
}
} else {
signale.info(`Crawl all feeds for ${this.address}`)
await DataBase.clearFeeds(this.siteId) // Delete all outdated content
modification.runtime.feeds = { last_check: now, last_refresh: now }
}
for (let name in this.dbSchema.feeds)
if (name)
await this.pagingFeedQuery(this.dbSchema.feeds[name], name, 800, 0, prevDate ? (prevDate / 1000) : 0) // Convert prevDate to linux time
}
() => exec(command).then(({ stdout, stderr }) => {
signale.note(stderr);
return stdout;
})
);
;(async function rollback() {
signale.info(`Rollback!`)
await removeTag(currentVersion)
await removeRemoteTag(currentVersion)
await revert()
await reset()
await forcedPush()
const manifestJsonFile = fs.readFileSync(manifestPath, {
encoding: 'utf-8',
})
const manifestJson = JSON.parse(manifestJsonFile)
const version = manifestJson.version
signale.note(`Current version: v${version}`)
})()