Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
receive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
Show more breadcrumbs
nilenso
receive
Merge requests
!21
Purge expired files
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Purge expired files
purge_expired_files
into
master
Overview
18
Commits
9
Pipelines
2
Changes
11
All threads resolved!
Hide all comments
Merged
danySam
requested to merge
purge_expired_files
into
master
4 years ago
Overview
18
Commits
9
Pipelines
2
Changes
11
All threads resolved!
Hide all comments
Expand
Files that have expired should be removed from the system when the job is done.
The file should be deleted from the hard disk and the DB entry deleted;
The job should be running periodically.
Users should see a 404 when trying to access such files.
Closes:
https://www.pivotaltracker.com/story/show/173350089
Edited
4 years ago
by
danySam
0
0
Merge request reports
Compare
master
version 1
cb7cdc36
4 years ago
master (base)
and
latest version
latest version
d4ef1f41
9 commits,
4 years ago
version 1
cb7cdc36
6 commits,
4 years ago
11 files
+
159
−
46
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
11
Search (e.g. *.vue) (Ctrl+P)
src/receive/db/sql.clj
+
16
−
0
Options
@@ -17,6 +17,11 @@
:timestamp
)
user-id
]])
sql/format
))
(
defn
get-file
[
uid
]
(
sql/format
{
:select
[
:*
]
:from
[
:file-storage
]
:where
[
:=
:uid
uid
]}))
(
defn
find-file
[
uid
]
(
sql/format
{
:select
[
:filename
@@ -27,6 +32,17 @@
:from
[
:file-storage
]
:where
[
:=
:uid
uid
]}))
(
defn
find-expired-files
[]
(
sql/format
{
:select
[
:filename
:uid
]
:from
[
:file-storage
]
:where
(
sql/call
:<
:dt_expire
(
sql/call
:now
))}))
(
defn
delete-file
[
uid
]
(
sql/format
{
:delete
[]
:from
[
:file-storage
]
:where
[
:=
:uid
uid
]}))
(
defn
get-google-user
[
google-id
]
(
sql/format
{
:select
[
:*
]
Loading