Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymilter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
misc
pymilter
Commits
279c831a
Commit
279c831a
authored
18 years ago
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Purge old entries in auto_whitelist and send_dsn logs.
parent
c0aa632e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Milter/cache.py
+11
-2
11 additions, 2 deletions
Milter/cache.py
with
11 additions
and
2 deletions
Milter/cache.py
+
11
−
2
View file @
279c831a
...
...
@@ -10,6 +10,9 @@
# CBV results.
#
# $Log$
# Revision 1.4 2007/01/11 04:31:26 customdesigned
# Negative feedback for bad headers. Purge cache logs on startup.
#
# Revision 1.3 2007/01/08 23:20:54 customdesigned
# Get user feedback.
#
...
...
@@ -45,6 +48,7 @@ class AddrCache(object):
now
=
time
.
time
()
lock
=
PLock
(
self
.
fname
)
wfp
=
lock
.
lock
()
changed
=
False
try
:
too_old
=
now
-
age
*
24
*
60
*
60
# max age in days
for
ln
in
open
(
self
.
fname
):
...
...
@@ -52,12 +56,17 @@ class AddrCache(object):
rcpt
,
ts
=
ln
.
strip
().
split
(
None
,
1
)
l
=
time
.
strptime
(
ts
,
AddrCache
.
time_format
)
t
=
time
.
mktime
(
l
)
if
t
<
too_old
:
continue
if
t
<
too_old
:
changed
=
True
continue
cache
[
rcpt
.
lower
()]
=
(
t
,
None
)
except
:
cache
[
ln
.
strip
().
lower
()]
=
(
now
,
None
)
wfp
.
write
(
ln
)
if
changed
:
lock
.
commit
(
self
.
fname
+
'
.old
'
)
else
:
lock
.
unlock
()
except
IOError
:
lock
.
unlock
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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