Merge branch 'feat/0.6.0/seo' into test

This commit is contained in:
aichy126 2022-12-13 16:29:22 +08:00
commit a681cd00dd
2 changed files with 3 additions and 2 deletions

View File

@ -29,6 +29,7 @@ func NewScheduledTaskManager(
func (s *ScheduledTaskManager) Run() {
fmt.Println("start cron")
s.questionService.SitemapCron(context.Background())
c := cron.New()
c.AddFunc("0 */1 * * *", func() {
ctx := context.Background()

View File

@ -72,8 +72,8 @@ func (t *TemplateRenderController) SitemapPage(ctx *gin.Context, page int) error
cachekey := fmt.Sprintf(schema.SitemapPageCachekey, page)
infoStr, err := t.data.Cache.GetString(ctx, cachekey)
if err != nil {
log.Errorf("get Cache failed: %s", err)
return err
//If there is no cache, return directly.
return nil
}
if err = json.Unmarshal([]byte(infoStr), sitemapInfo); err != nil {
log.Errorf("get sitemap info failed: %s", err)