Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
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
drupal.org
feeds
Commits
0cfb7489
Commit
0cfb7489
authored
14 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
Quick fix to progress reporting for deleting items. Will need more love.
parent
007b44a8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
includes/FeedsSource.inc
+15
-2
15 additions, 2 deletions
includes/FeedsSource.inc
plugins/FeedsNodeProcessor.inc
+1
-1
1 addition, 1 deletion
plugins/FeedsNodeProcessor.inc
with
16 additions
and
3 deletions
includes/FeedsSource.inc
+
15
−
2
View file @
0cfb7489
...
...
@@ -88,7 +88,7 @@ class FeedsState {
*/
public
function
__construct
()
{
$this
->
total
=
$this
->
progress
=
1
;
$this
->
progress
=
$this
->
created
=
$this
->
updated
=
$this
->
deleted
=
...
...
@@ -103,12 +103,24 @@ class FeedsState {
* A float between 0 and 1, 1 = FEEDS_BATCH_COMPLETE.
*/
public
function
progress
()
{
// If no total and no progress is reported, we are done.
if
(
empty
(
$this
->
total
)
&&
empty
(
$this
->
progress
))
{
return
FEEDS_BATCH_COMPLETE
;
}
$progress
=
$this
->
progress
/
$this
->
total
;
if
(
$progress
==
FEEDS_BATCH_COMPLETE
&&
$this
->
total
!=
$this
->
progress
)
{
return
0.999
;
}
return
$progress
;
}
/**
* Sets this state to finished.
*/
public
function
finished
()
{
$this
->
total
=
$this
->
progress
=
FEEDS_BATCH_COMPLETE
;
}
}
/**
...
...
@@ -282,7 +294,8 @@ class FeedsSource extends FeedsConfigurable {
}
// Fetching envelops parsing.
$parser_progress
=
$parser
->
progress
()
/
$fetcher
->
total
;
return
$fetcher
->
progress
-
1.0
+
$parser_progress
;
$fetcher_fraction
=
1.0
/
$fetcher
->
total
;
return
$fetcher
->
progress
()
-
$fetcher_fraction
+
$parser_progress
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
plugins/FeedsNodeProcessor.inc
+
1
−
1
View file @
0cfb7489
...
...
@@ -99,7 +99,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
else
{
drupal_set_message
(
t
(
'There is no content to be deleted.'
));
}
$state
->
progress
=
FEEDS_BATCH_COMPLETE
;
$state
->
finished
()
;
}
/**
...
...
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