catch sitemap generation error during setup
This commit is contained in:
@@ -64,9 +64,13 @@ module.exports = {
|
||||
],
|
||||
routes: async () => {
|
||||
if (config.status === 'READY') {
|
||||
try {
|
||||
const Event = require('./server/api/models/event')
|
||||
const events = await Event.findAll({where: { is_visible: true }})
|
||||
return events.map(e => `/event/${e.slug}`)
|
||||
} catch (e) {
|
||||
return []
|
||||
}
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user