aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-22 04:35:49 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-22 04:35:49 +0100
commit0b5d388af213680d0def2c03d3c8814c3e2ceaa2 (patch)
tree6f0e4792e9374952c2845af84bc94428f59af644 /main.go
parent97737c46f37f76aa80d91c52710e2ca2c3d0ba4f (diff)
downloadgallery-0b5d388af213680d0def2c03d3c8814c3e2ceaa2.tar.gz
gallery-0b5d388af213680d0def2c03d3c8814c3e2ceaa2.tar.xz
gallery-0b5d388af213680d0def2c03d3c8814c3e2ceaa2.zip
WIP: FS to DB sync
Diffstat (limited to 'main.go')
-rw-r--r--main.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/main.go b/main.go
index 64cf26c..d1fdbb9 100644
--- a/main.go
+++ b/main.go
@@ -1037,7 +1037,12 @@ func syncPostProcess(c *syncContext, info syncFileInfo) error {
switch {
case info.err != nil:
// * → error
- return info.err
+ if ee, ok := info.err.(*exec.ExitError); ok {
+ syncPrintf(c, "%s: %s", info.fsPath, ee.Stderr)
+ } else {
+ return info.err
+ }
+ fallthrough
case info.sha1 == "":
// 0 → 0
@@ -1696,10 +1701,15 @@ func cmdThumbnail(args []string) error {
defer taskSemaphore.release()
defer wg.Done()
if err := makeThumbnailFor(sha1); err != nil {
- cancel(err)
- } else {
- pb.Step()
+ if ee, ok := err.(*exec.ExitError); ok {
+ pb.Stop()
+ log.Printf("%s: %s\n", sha1, ee.Stderr)
+ pb.Update()
+ } else {
+ cancel(err)
+ }
}
+ pb.Step()
}(sha1)
}
wg.Wait()