stash/pkg/manager
SmallCoccinelle 87709fd018
Errcheck phase 1 (#1715)
* Avoid redundant logging in migrations

Return the error and let the caller handle the logging of the error if
needed.

While here, defer m.Close() to the function boundary.

* Treat errors as values

Use %v rather than %s and pass the errors directly.

* Generate a wrapped error on stat-failure

* Log 3 unchecked errors

Rather than ignore errors, log them at
the WARNING log level.

The server has been functioning without these, so assume they are not at
the ERROR level.

* Propagate errors upward

Failure in path generation was ignored. Propagate the errors upward the
call stack, so it can be handled at the level of orchestration.

* Warn on errors

Log errors rather than quenching them.

Errors are logged at the Warn-level for now.

* Check error when creating test databases

Use the builtin log package and stop the program fatally on error.

* Add warnings to uncheck task errors

Focus on the task system in a single commit, logging unchecked
errors as warnings.

* Warn-on-error in API routes

Look through the API routes, and make sure errors are being logged if
they occur. Prefer the Warn-log-level because none of these has proven
to be fatal in the system up until now.

* Propagate error when adding Util API

* Propagate error on adding util API

* Return unhandled error

* JS log API: propagate and log errors

* JS Plugins: log GQL addition failures.

* Warn on failure to write to stdin

* Warn on failure to stop task

* Wrap viper.BindEnv

The current viper code only errors if no name is provided, so it should
never fail. Rewrite the code flow to factor through a panic-function.

This removes error warnings from this part of the code.

* Log errors in concurrency test

If we can't initialize the configuration, treat the test as a failure.

* Warn on errors in configuration code

* Plug an unchecked error in gallery zip walking

* Warn on screenshot serving failure

* Warn on encoder screenshot failure

* Warn on errors in path-handling code

* Undo the errcheck on configurations for now.

* Use one-line initializers where applicable

rather than using

  err := f()
  if err!= nil { ..

prefer the shorter

  if err := f(); err != nil { ..

If f() isn't too long of a name, or wraps a function with a body.
2021-09-21 09:34:25 +10:00
..
config Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
jsonschema Studio aliases (#1660) 2021-09-09 18:13:42 +10:00
paths Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
apikey.go Setup and migration UI refactor (#1190) 2021-04-12 09:31:33 +10:00
checksum.go Fix: config race conditions with RWMutex (#1645) 2021-08-24 15:18:30 +10:00
downloads.go Selective export (#770) 2020-09-15 17:28:53 +10:00
exclude_files.go Cleanup fixes (#1422) 2021-05-25 11:03:09 +10:00
exclude_files_test.go Added exclude patterns support for Clean Task (#274) 2019-12-23 21:06:07 -05:00
filename_parser.go Studio aliases (#1660) 2021-09-09 18:13:42 +10:00
gallery.go Images section (#813) 2020-10-13 10:12:46 +11:00
generator.go Make audio stream optional for preview generation (#1454) 2021-06-11 15:01:32 +10:00
generator_phash.go Add in-memory screenshot generation for sprites and phash (#1316) 2021-05-05 13:22:05 +10:00
generator_preview.go Make audio stream optional for preview generation (#1454) 2021-06-11 15:01:32 +10:00
generator_sprite.go Fix: unhandled errors (#1419) 2021-05-25 18:40:51 +10:00
image.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
import.go Add partial import functionality (#812) 2020-09-20 18:36:02 +10:00
json_utils.go Images section (#813) 2020-10-13 10:12:46 +11:00
manager.go When stopping, close the database (#1686) 2021-09-07 14:28:40 +10:00
manager_tasks.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
migrate_hash.go Migrate generated files when a scene is rescanned (#1106) 2021-02-10 10:50:34 +11:00
post_migrate.go Data layer restructuring (#997) 2021-01-18 12:23:20 +11:00
running_streams.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
scene.go Generate screenshot images for markers (#1604) 2021-09-15 12:27:05 +10:00
scene_screenshot.go Allow uploading of custom scene covers (#262) 2019-12-13 15:40:58 -05:00
screenshot.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
studio.go Data layer restructuring (#997) 2021-01-18 12:23:20 +11:00
subscribe.go Job queueing (#1379) 2021-05-24 14:24:18 +10:00
task.go Job queueing (#1379) 2021-05-24 14:24:18 +10:00
task_autotag.go Fix autotag tag alias (#1713) 2021-09-17 09:23:56 +10:00
task_clean.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
task_export.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
task_generate_markers.go Generate screenshot images for markers (#1604) 2021-09-15 12:27:05 +10:00
task_generate_phash.go Overwrite phash during generate if flag set (#1633) 2021-08-11 16:08:10 +10:00
task_generate_preview.go Make audio stream optional for preview generation (#1454) 2021-06-11 15:01:32 +10:00
task_generate_screenshot.go Error strings noncapitalized (#1704) 2021-09-08 11:23:10 +10:00
task_generate_sprite.go Strip file extension from scene title when scanning (#1022) 2021-01-07 11:38:30 +11:00
task_import.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
task_migrate_hash.go Migrate generated files when a scene is rescanned (#1106) 2021-02-10 10:50:34 +11:00
task_plugin.go Plugin hooks (#1452) 2021-06-11 17:24:58 +10:00
task_scan.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
task_stash_box_tag.go Errcheck phase 1 (#1715) 2021-09-21 09:34:25 +10:00
task_transcode.go Cleanup fixes (#1422) 2021-05-25 11:03:09 +10:00