Store generated links in MongoDB, along with expiry datetime.
Links are only regenerated after they have expired. For backward compatibility the links are also generated when there is no expiry or link. Every file has only one expiry timestamp for all its links. In the future we might want to inspect the used projection, to see whether the client needs those links at all (prevents unnecessary regeneration), and to force inclusion of the expiry timestamp when links are requested.
This commit is contained in:
@@ -413,6 +413,12 @@ files_schema = {
|
||||
#'required': True,
|
||||
'unique': True,
|
||||
},
|
||||
'link': {
|
||||
'type': 'string',
|
||||
},
|
||||
'link_expires': {
|
||||
'type': 'datetime',
|
||||
},
|
||||
'project': {
|
||||
# The project node the files belongs to (does not matter if it is
|
||||
# attached to an asset or something else). We use the project id as
|
||||
@@ -463,6 +469,9 @@ files_schema = {
|
||||
'file_path': {
|
||||
'type': 'string',
|
||||
},
|
||||
'link': {
|
||||
'type': 'string',
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user