Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Strand Lab Cellxgene Gateway
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Strand Lab
Strand Lab Cellxgene Gateway
Commits
2d6d868c
Commit
2d6d868c
authored
5 years ago
by
Alok Saldanha
Browse files
Options
Downloads
Patches
Plain Diff
#9 only prune entries that have a pid
parent
91c96078
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cellxgene_gateway/prune_process_cache.py
+4
-3
4 additions, 3 deletions
cellxgene_gateway/prune_process_cache.py
with
4 additions
and
3 deletions
cellxgene_gateway/prune_process_cache.py
+
4
−
3
View file @
2d6d868c
...
...
@@ -13,7 +13,6 @@ import logging
from
cellxgene_gateway.util
import
current_time_stamp
from
cellxgene_gateway.env
import
ttl
class
PruneProcessCache
:
def
__init__
(
self
,
cache
):
self
.
cache
=
cache
...
...
@@ -27,8 +26,10 @@ class PruneProcessCache:
def
prune
(
self
):
timestamp
=
current_time_stamp
()
cutoff
=
timestamp
-
self
.
expire_seconds
processes_to_delete
=
[
p
for
p
in
self
.
cache
.
entry_list
if
p
.
timestamp
<
cutoff
]
processes_to_keep
=
[
p
for
p
in
self
.
cache
.
entry_list
if
not
p
.
timestamp
<
cutoff
]
def
prunable
(
p
):
return
p
.
timestamp
<
cutoff
and
p
.
pid
!=
None
processes_to_delete
=
[
p
for
p
in
self
.
cache
.
entry_list
if
prunable
(
p
)]
processes_to_keep
=
[
p
for
p
in
self
.
cache
.
entry_list
if
not
prunable
(
p
)]
logger
=
logging
.
getLogger
(
"
cellxgene_gateway
"
)
logger
.
debug
(
f
"
Cutoff
{
cutoff
}
= timestamp
{
timestamp
}
- expire seconds
{
self
.
expire_seconds
}
, keeping
{
processes_to_keep
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment