3750-claim_photo #935
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#935
Loading…
Reference in New Issue
No description provided.
Delete Branch "3750-claim_photo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -86,0 +89,4 @@
"name": "claimStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/claim",
"root": "./storage/dms" is the existing folder for the DMS, use it.
@ -0,0 +3,4 @@
module.exports = Self => {
Self.remoteMethodCtx('deleteOldFiles', {
description: 'Delete files that are 6 months old from "./storage/claim"',
Deletes files that are 6 months old from dms
@ -0,0 +26,4 @@
myOptions.transaction = tx;
try {
const claimContainer = './storage/claim';
You need to obtain the claim storage directories dynamically
Please don't use './storage/claim' since that won't work in test/prod.
investigate loopback-component-storage to list all the containers.
@ -0,0 +38,4 @@
srcFile = path.join(srcFoulder, file);
const {birthtime} = fs.statSync(srcFile);
const sixMonthsAgo = new Date();
sixMonthsAgo.setMonth(sixMonthsAgo.getMonth() - 6);
checking directory creation/modification date doesn't show how old the contained files are. beware
LGTM