Shutdown implements imagor.Processor interface
(ctx context.Context)
| 189 | |
| 190 | // Shutdown implements imagor.Processor interface |
| 191 | func (v *Processor) Shutdown(ctx context.Context) error { |
| 192 | processorLock.Lock() |
| 193 | defer processorLock.Unlock() |
| 194 | if processorCount <= 0 { |
| 195 | return nil |
| 196 | } |
| 197 | processorCount-- |
| 198 | if processorCount == 0 { |
| 199 | vips.Shutdown() |
| 200 | } |
| 201 | if v.cache != nil { |
| 202 | v.cache.Close() |
| 203 | v.cache = nil |
| 204 | } |
| 205 | for _, d := range v.Detectors { |
| 206 | _ = d.Shutdown(ctx) |
| 207 | } |
| 208 | return nil |
| 209 | } |
| 210 | |
| 211 | func (v *Processor) newSourceReaderFromBlob(blob *imagor.Blob) (io.ReadCloser, error) { |
| 212 | reader, _, err := blob.NewReadSeeker() |