mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 20:32:13 +01:00
improving lock mechanism for office conversion: now check if context has timeout when trying to acquire the lock + office printer test
This commit is contained in:
@@ -34,13 +34,13 @@ func NewMergePrinter(logger xlog.Logger, fpaths []string, opts MergePrinterOptio
|
||||
|
||||
func (p mergePrinter) Print(destination string) error {
|
||||
const op string = "printer.mergePrinter.Print"
|
||||
logOptions(p.logger, p.opts)
|
||||
/*
|
||||
context.Context may be providen from
|
||||
an officePrinter which needs to merge
|
||||
its result files.
|
||||
*/
|
||||
if p.ctx == nil {
|
||||
logOptions(p.logger, p.opts)
|
||||
ctx, cancel := xcontext.WithTimeout(p.logger, p.opts.WaitTimeout)
|
||||
defer cancel()
|
||||
p.ctx = ctx
|
||||
|
||||
Reference in New Issue
Block a user