aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/bots.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/bots.ts')
-rw-r--r--server/controllers/bots.ts12
1 files changed, 3 insertions, 9 deletions
diff --git a/server/controllers/bots.ts b/server/controllers/bots.ts
index e25d9c21b..ed1040176 100644
--- a/server/controllers/bots.ts
+++ b/server/controllers/bots.ts
@@ -2,7 +2,6 @@ import * as express from 'express'
2import { asyncMiddleware } from '../middlewares' 2import { asyncMiddleware } from '../middlewares'
3import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../initializers/constants' 3import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../initializers/constants'
4import * as sitemapModule from 'sitemap' 4import * as sitemapModule from 'sitemap'
5import { logger } from '../helpers/logger'
6import { VideoModel } from '../models/video/video' 5import { VideoModel } from '../models/video/video'
7import { VideoChannelModel } from '../models/video/video-channel' 6import { VideoChannelModel } from '../models/video/video-channel'
8import { AccountModel } from '../models/account/account' 7import { AccountModel } from '../models/account/account'
@@ -39,15 +38,10 @@ async function getSitemap (req: express.Request, res: express.Response) {
39 urls: urls 38 urls: urls
40 }) 39 })
41 40
42 sitemap.toXML((err, xml) => { 41 const xml = sitemap.toXML()
43 if (err) {
44 logger.error('Cannot generate sitemap.', { err })
45 return res.sendStatus(500)
46 }
47 42
48 res.header('Content-Type', 'application/xml') 43 res.header('Content-Type', 'application/xml')
49 res.send(xml) 44 res.send(xml)
50 })
51} 45}
52 46
53async function getSitemapVideoChannelUrls () { 47async function getSitemapVideoChannelUrls () {