mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-18 13:12:17 +01:00
reordering code
This commit is contained in:
@@ -109,7 +109,6 @@ func (p chromePrinter) Print(destination string) error {
|
|||||||
defer newContextConn.Close() // nolint: errcheck
|
defer newContextConn.Close() // nolint: errcheck
|
||||||
// create a new CDP Client that uses newContextConn.
|
// create a new CDP Client that uses newContextConn.
|
||||||
targetClient := cdp.NewClient(newContextConn)
|
targetClient := cdp.NewClient(newContextConn)
|
||||||
closeTargetArgs := target.NewCloseTargetArgs(newTarget.TargetID)
|
|
||||||
/*
|
/*
|
||||||
close the target when done.
|
close the target when done.
|
||||||
we're not using the "default" context
|
we're not using the "default" context
|
||||||
@@ -117,6 +116,7 @@ func (p chromePrinter) Print(destination string) error {
|
|||||||
the target.
|
the target.
|
||||||
see: https://github.com/mafredri/cdp/issues/101#issuecomment-524533670
|
see: https://github.com/mafredri/cdp/issues/101#issuecomment-524533670
|
||||||
*/
|
*/
|
||||||
|
closeTargetArgs := target.NewCloseTargetArgs(newTarget.TargetID)
|
||||||
defer targetClient.Target.CloseTarget(context.Background(), closeTargetArgs) // nolint: errcheck
|
defer targetClient.Target.CloseTarget(context.Background(), closeTargetArgs) // nolint: errcheck
|
||||||
// enable all events.
|
// enable all events.
|
||||||
if err := p.enableEvents(ctx, targetClient); err != nil {
|
if err := p.enableEvents(ctx, targetClient); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user