Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443488
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443488
Commits
e8c67464
Commit
e8c67464
authored
15 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#60468
by alex_b, JamesAn: allow aggregator feed items to never be discarded.
parent
eaf18f4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/aggregator/aggregator.processor.inc
+24
-10
24 additions, 10 deletions
modules/aggregator/aggregator.processor.inc
with
24 additions
and
10 deletions
modules/aggregator/aggregator.processor.inc
+
24
−
10
View file @
e8c67464
...
...
@@ -6,6 +6,11 @@
* Processor functions for the aggregator module.
*/
/**
* Denotes that a feed's items should never expire.
*/
define
(
'AGGREGATOR_CLEAR_NEVER'
,
0
);
/**
* Implementation of hook_aggregator_process_info().
*/
...
...
@@ -72,6 +77,7 @@ function aggregator_form_aggregator_admin_form_alter(&$form, $form_state) {
$info
=
module_invoke
(
'aggregator'
,
'aggregator_process'
,
'info'
);
$items
=
array
(
0
=>
t
(
'none'
))
+
drupal_map_assoc
(
array
(
3
,
5
,
10
,
15
,
20
,
25
),
'_aggregator_items'
);
$period
=
drupal_map_assoc
(
array
(
3600
,
10800
,
21600
,
32400
,
43200
,
86400
,
172800
,
259200
,
604800
,
1209600
,
2419200
,
4838400
,
9676800
),
'format_interval'
);
$period
[
AGGREGATOR_CLEAR_NEVER
]
=
t
(
'Never'
);
// Only wrap into a collapsible fieldset if there is a basic configuration.
if
(
isset
(
$form
[
'basic_conf'
]))
{
...
...
@@ -163,15 +169,23 @@ function aggregator_save_item($edit) {
* Object describing feed.
*/
function
aggregator_expire
(
$feed
)
{
// Remove all items that are older than flush item timer.
$age
=
REQUEST_TIME
-
variable_get
(
'aggregator_clear'
,
9676800
);
$iids
=
db_query
(
'SELECT iid FROM {aggregator_item} WHERE fid = :fid AND timestamp < :timestamp'
,
array
(
':fid'
=>
$feed
->
fid
,
':timestamp'
=>
$age
))
->
fetchCol
();
if
(
$iids
)
{
db_delete
(
'aggregator_category_item'
)
->
condition
(
'iid'
,
$iids
,
'IN'
)
->
execute
();
db_delete
(
'aggregator_item'
)
->
condition
(
'iid'
,
$iids
,
'IN'
)
->
execute
();
$aggregator_clear
=
variable_get
(
'aggregator_clear'
,
9676800
);
if
(
$aggregator_clear
!=
AGGREGATOR_CLEAR_NEVER
)
{
// Remove all items that are older than flush item timer.
$age
=
REQUEST_TIME
-
$aggregator_clear
;
$iids
=
db_query
(
'SELECT iid FROM {aggregator_item} WHERE fid = :fid AND timestamp < :timestamp'
,
array
(
':fid'
=>
$feed
->
fid
,
':timestamp'
=>
$age
,
))
->
fetchCol
();
if
(
$iids
)
{
db_delete
(
'aggregator_category_item'
)
->
condition
(
'iid'
,
$iids
,
'IN'
)
->
execute
();
db_delete
(
'aggregator_item'
)
->
condition
(
'iid'
,
$iids
,
'IN'
)
->
execute
();
}
}
}
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