mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-19 18:22:10 +08:00
增加项目导出目录配置,可自定义导出的缓存目录
This commit is contained in:
@@ -216,9 +216,12 @@ func (m *BookResult) ToBookResult(book Book) *BookResult {
|
||||
|
||||
//后台转换
|
||||
func BackgroupConvert(sessionId string,bookResult *BookResult){
|
||||
exportLimitWorkerChannel.LoadOrStore(bookResult.Identify, func() {
|
||||
err := exportLimitWorkerChannel.LoadOrStore(bookResult.Identify, func() {
|
||||
bookResult.Converter(sessionId)
|
||||
})
|
||||
if err != nil {
|
||||
beego.Error("将导出任务加入任务队列失败 -> ",err)
|
||||
}
|
||||
exportLimitWorkerChannel.Start()
|
||||
}
|
||||
|
||||
@@ -227,7 +230,7 @@ func (m *BookResult) Converter(sessionId string) (ConvertBookResult, error) {
|
||||
|
||||
convertBookResult := ConvertBookResult{}
|
||||
|
||||
outputPath := filepath.Join(conf.WorkingDirectory, "uploads", "books", strconv.Itoa(m.BookId))
|
||||
outputPath := filepath.Join(conf.GetExportOutputPath(), strconv.Itoa(m.BookId))
|
||||
viewPath := beego.BConfig.WebConfig.ViewsPath
|
||||
|
||||
pdfpath := filepath.Join(outputPath, "book.pdf")
|
||||
|
Reference in New Issue
Block a user