annotate Sphinx/source/plugins/delayed-deletion-plugin.rst @ 1113:a588960a72e5 default tip

spelling
author Alain Mazy <am@orthanc.team>
date Mon, 28 Oct 2024 09:23:08 +0100
parents b9fe60571a3e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
861
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
1 .. _delayed-deletion-plugin:
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
2
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
3
1043
683f238333cf reorganized the list of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 861
diff changeset
4 Delayed deletion plugin
683f238333cf reorganized the list of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 861
diff changeset
5 =======================
683f238333cf reorganized the list of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 861
diff changeset
6
683f238333cf reorganized the list of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 861
diff changeset
7 .. contents::
861
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
8
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
9 This page describes the **official sample plugin** that performs
1043
683f238333cf reorganized the list of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 861
diff changeset
10 delayed deletions of storage files. This plugin was **introduced in
683f238333cf reorganized the list of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 861
diff changeset
11 Orthanc 1.11.1** as part of its official distribution.
861
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
12
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
13 On some file systems, the deletion of files can be quite long and therefore,
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
14 a ``DELETE`` request on a study with thousands of instances can last minutes.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
15
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
16 The Delayed deletion plugin handles file deletion asynchronously by pushing
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
17 the files to delete into a queue that is handled asynchronously.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
18 This queue is stored in a SQLite DB stored on disk which allows the plugin
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
19 to resume deletions if Orthanc is stopped/restarted while deleting files.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
20
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
21
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
22 Configuration
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
23 -------------
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
24
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
25 .. highlight:: json
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
26
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
27 Here's a sample configuration section for this plugin with its default values::
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
28
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
29 {
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
30 "DelayedDeletion": {
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
31
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
32 // Enables/disables the plugin
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
33 "Enable": false,
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
34
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
35 // Delay (in milliseconds) between deletion of 2 files
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
36 // This avoids overloading Orthanc disk with the deletion
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
37 // of files and leaves room for other operations.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
38 // '0' means no throttling.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
39 "ThrottleDelayMs": 0,
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
40
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
41 // Force the path of the SQLite DB
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
42 // By default, this value is generated by the plugin base on
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
43 // the "StorageDirectory" and "DatabaseServerIdentifier"
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
44 // configurations.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
45 // If running multiple Orthanc on the same storage, make
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
46 // sure that they use different "Path" for the DelayedDeletion DB
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
47 // "Path": "/my/path/delayed-deletion.db"
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
48 }
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
49 }
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
50
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
51 Working with multiple Orthanc instances
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
52 ---------------------------------------
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
53
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
54 When running multiple instance on the same DB (e.g a PostgreSQL DB), each
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
55 Delayed Deletion plugin will maintain its own list of files to delete and
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
56 store it in its own SQLite DB. To make sure each instance has its own
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
57 DB, the plugin uses the ``DatabaseServerIdentifier`` configuration to
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
58 generate the name of the SQLite DB.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
59
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
60
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
61
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
62 Status
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
63 ------
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
64
1073
b9fe60571a3e fixed delayed-deletion status url
Alain Mazy <am@orthanc.team>
parents: 1043
diff changeset
65 You can get a progress status of the plugin by calling the ``/plugins/delayed-deletion/status`` API route.
861
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
66
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
67
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
68 Compilation
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
69 -----------
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
70
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
71 This plugin is part of the Orthanc core repository and is included in the Orthanc makefile.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
72 It is compiled with Orthanc itself and is distributed together with Orthanc binaries.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
73
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
74
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
75