Link

Automating file removal

Table of contents

  1. What is its function
  2. How to set this value
  3. Default Value
  4. How to use with Docker

What is its function

This is an optional feature to automate the removal of input files, converted output, and the state of a conversion. Using this feature removes the reliance on an external task to clear these files.
This function is controlled by 3 different config properties.

  1. fileDeletionService - Should the file deletion service be used.
  2. fileDeletionService.frequency - How often should files be checked for deletion, in minutes.
  3. individualTTL - How long, in milliseconds, until the status of the conversion job is removed from the system and, if fileDeletionService is true, the related files deleted.

How to set this value

Create the following Java properties file on the server running your app server (if you don’t already have one) {user.home}/.idr/jpedal-microservice/jpedal-microservice.properties

In this file add (or update if the key already exists) the following key and value pair.

  1. fileDeletionService - This value can be true or false
    e.g fileDeletionService=false
  2. fileDeletionService.frequency - This can be a value between 0 and 9,223,372,036,854,775,807
    e.g fileDeletionService.frequency=5
  3. individualTTL - This can be a value between 0 and 9,223,372,036,854,775,807
    e.g individualTTL=86400000

Default Value

When no values are provided or invalid values are provided the following default values are used.
This will not automatically delete files but will clear a conversions status or any UUID created over 24 hours ago.

  1. fileDeletionService=false
  2. fileDeletionService.frequency=5
  3. individualTTL=86400000

How to use with Docker

In order to provide your own properties file to the Docker image you need to mount the properties file to the image. This is done by adding the following to your docker run command.

--mount "source=/path/to/properties/directory/jpedal-microservice.properties,target=/root/.idr/jpedal-microservice/jpedal-microservice.properties,type=bind"