Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit 8fc24b6

Browse files
authored
docs: remove retries (#40)
1 parent 5c1a580 commit 8fc24b6

File tree

2 files changed

+46
-37
lines changed

2 files changed

+46
-37
lines changed

README.md

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,32 @@ In addition, this rewrite introduces a more modular approach and should be easy
99

1010
## Table of contents
1111

12-
- [Early Access](#early-access)
13-
- [Installing autoscan](#installing-autoscan)
14-
- [Introduction](#introduction)
15-
- [Rewriting paths](#rewriting-paths)
16-
- [Triggers](#triggers)
17-
- [Processor](#processor)
18-
- [Targets](#targets)
19-
- [Full config file](#full-config-file)
20-
- [Other installation options](#other-installation-options)
21-
- [Docker](#docker)
12+
- [Autoscan](#autoscan)
13+
- [Table of contents](#table-of-contents)
14+
- [Early Access](#early-access)
15+
- [Installing autoscan](#installing-autoscan)
16+
- [Introduction](#introduction)
17+
- [Rewriting paths](#rewriting-paths)
18+
- [Simple example](#simple-example)
19+
- [Triggers](#triggers)
20+
- [Daemons](#daemons)
21+
- [Webhooks](#webhooks)
22+
- [Configuration](#configuration)
23+
- [Connecting the -arrs](#connecting-the--arrs)
24+
- [Processor](#processor)
25+
- [Anchor files](#anchor-files)
26+
- [Minimum age](#minimum-age)
27+
- [Customising the processor](#customising-the-processor)
28+
- [Targets](#targets)
29+
- [Plex](#plex)
30+
- [Emby](#emby)
31+
- [Full config file](#full-config-file)
32+
- [Other installation options](#other-installation-options)
33+
- [Docker](#docker)
34+
- [Version Tags](#version-tags)
35+
- [Usage](#usage)
36+
- [Parameters](#parameters)
37+
- [Cloudbox](#cloudbox)
2238

2339
## Early Access
2440

@@ -152,8 +168,8 @@ Daemons run in the background and continuously fetch new changes based on a [cro
152168

153169
The following daemons are currently provided by Autoscan:
154170

155-
- Google Drive
156-
- inotify
171+
- Google Drive (Bernard)
172+
- Inotify
157173

158174
#### Webhooks
159175

@@ -201,16 +217,16 @@ triggers:
201217
202218
# filter with regular expressions
203219
include:
204-
- "^/mnt/unionfs/Media/*"
220+
- '^/mnt/unionfs/Media/*'
205221
exclude:
206-
- "\.srt$"
222+
- '\.srt$'
207223
208224
inotify:
209225
- priority: 0
210226
211227
# filter with regular expressions
212228
include:
213-
- '/mnt/unionfs/Media/*'
229+
- '^/mnt/unionfs/Media/*'
214230
exclude:
215231
- '\.(srt|pdf)$'
216232
@@ -264,14 +280,9 @@ The processor then saves the Scans to its datastore.
264280
*The processor uses SQLite as its datastore, feel free to hack around!*
265281

266282
In a separate process, the processor selects Scans from the datastore.
267-
It will always group files belonging to the same folder together and it waits until all the files in that folder are older than the `minimum-age`, which defaults to 5 minutes.
283+
It will always group files belonging to the same folder together and it waits until all the files in that folder are older than the `minimum-age`, which defaults to 10 minutes.
268284

269-
When all files are older than the minimum age, the processor will check whether all files exist on the local file system.
270-
When at least one file exists on the file system, then the processor will call all the configured targets in parallel to request a folder scan.
271-
272-
When a file does not exist, the processor will increment the `retries` field of the Scan.
273-
It also resets the timestamp so the file will not get scanned for at least `minimum-age`.
274-
A Scan can only be retried up to a maximum number of retries, which defaults to 5.
285+
When all files are older than the minimum age, then the processor will call all the configured targets in parallel to request a folder scan.
275286

276287
#### Anchor files
277288

@@ -287,19 +298,23 @@ Each remote mount MUST have its own anchor file and its own name for that anchor
287298
In addition, make sure to define the 'merged' path to the file and not the remote mount path.
288299
This helps check whether the union-software is working correctly as well.
289300

301+
#### Minimum age
302+
303+
Autoscan does not check whether scan requests received by triggers exist on the file system.
304+
Therefore, to make sure a file exists before it reaches the targets, you should set a minimum age.
305+
The minimum age delays the scan from being send to the targets after it has been added to the queue by a trigger.
306+
The default minimum age is set at 10 minutes to prevent common synchronisation issues.
307+
290308
#### Customising the processor
291309

292-
The processor allows you to set the maximum number of retries, as well as the minimum age of a Scan.
310+
The processor allows you to set the minimum age of a Scan.
293311
In addition, you can also define a list of anchor files.
294312

295313
A snippet of the `config.yml` file:
296314

297315
```yaml
298-
# override the maximum number of retries
299-
retries: 10
300-
301-
# override the minimum age to 2 minutes:
302-
minimum-age: 2m
316+
# override the minimum age to 30 minutes:
317+
minimum-age: 30m
303318
304319
# set multiple anchor files
305320
anchors:
@@ -377,11 +392,8 @@ With the examples given in the [triggers](#triggers), [processor](#processor) an
377392
```yaml
378393
# <- processor ->
379394
380-
# override the maximum number of retries
381-
retries: 10
382-
383-
# override the minimum age to 2 minutes:
384-
minimum-age: 2m
395+
# override the minimum age to 30 minutes:
396+
minimum-age: 30m
385397
386398
# set multiple anchor files
387399
anchors:

cmd/autoscan/main.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
type config struct {
3131
// General configuration
3232
Port int `yaml:"port"`
33-
MaxRetries int `yaml:"retries"`
3433
MinimumAge time.Duration `yaml:"minimum-age"`
3534
Anchors []string `yaml:"anchors"`
3635

@@ -147,8 +146,7 @@ func main() {
147146

148147
// set default values
149148
c := config{
150-
MaxRetries: 5,
151-
MinimumAge: 300 * time.Second,
149+
MinimumAge: 10 * time.Minute,
152150
Port: 3030,
153151
}
154152

@@ -175,7 +173,6 @@ func main() {
175173

176174
log.Info().
177175
Stringer("min_age", c.MinimumAge).
178-
Int("max_retries", c.MaxRetries).
179176
Strs("anchors", c.Anchors).
180177
Msg("Initialised processor")
181178

0 commit comments

Comments
 (0)