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