Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
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
die_coolen_jungs
our_own_cloud_project
Commits
6025d2eb
Commit
6025d2eb
authored
12 years ago
by
Jakob Sack
Browse files
Options
Downloads
Patches
Plain Diff
Rename Backgroundjobs to BackgroundJob
parent
4f908600
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/backgroundjobs/regulartask.php
+2
-2
2 additions, 2 deletions
lib/backgroundjobs/regulartask.php
lib/backgroundjobs/scheduledtask.php
+1
-2
1 addition, 2 deletions
lib/backgroundjobs/scheduledtask.php
lib/backgroundjobs/worker.php
+7
-7
7 additions, 7 deletions
lib/backgroundjobs/worker.php
with
10 additions
and
11 deletions
lib/backgroundjobs/regulartask.php
+
2
−
2
View file @
6025d2eb
...
...
@@ -23,7 +23,7 @@
/**
* This class manages the regular tasks.
*/
class
OC_Background
j
ob
s
_RegularTask
{
class
OC_Background
J
ob_RegularTask
{
static
private
$registered
=
array
();
/**
...
...
@@ -32,7 +32,7 @@ class OC_Backgroundjobs_RegularTask{
* @param $method method name
* @return true
*/
static
public
function
c
re
a
te
(
$klass
,
$method
){
static
public
function
re
gis
te
r
(
$klass
,
$method
){
// Create the data structure
self
::
$registered
[
"
$klass
-
$method
"
]
=
array
(
$klass
,
$method
);
...
...
This diff is collapsed.
Click to expand it.
lib/backgroundjobs/scheduledtask.php
+
1
−
2
View file @
6025d2eb
<?php
/**
* ownCloud - Background Job
*
...
...
@@ -24,7 +23,7 @@
/**
* This class manages our scheduled tasks.
*/
class
OC_Background
j
ob
s
_ScheduledTask
{
class
OC_Background
J
ob_ScheduledTask
{
/**
* @brief Gets one scheduled task
* @param $id ID of the task
...
...
This diff is collapsed.
Click to expand it.
lib/backgroundjobs/worker.php
+
7
−
7
View file @
6025d2eb
...
...
@@ -25,7 +25,7 @@
*
* TODO: locking in doAllSteps
*/
class
OC_Background
j
ob
s
_Worker
{
class
OC_Background
J
ob_Worker
{
/**
* @brief executes all tasks
* @return boolean
...
...
@@ -36,16 +36,16 @@ class OC_Backgroundjobs_Worker{
*/
public
static
function
doAllSteps
(){
// Do our regular work
$regular_tasks
=
OC_Background
j
ob
s
_RegularTask
::
all
();
$regular_tasks
=
OC_Background
J
ob_RegularTask
::
all
();
foreach
(
$regular_tasks
as
$key
=>
$value
){
call_user_func
(
$value
);
}
// Do our scheduled tasks
$scheduled_tasks
=
OC_Background
j
ob
s
_ScheduledTask
::
all
();
$scheduled_tasks
=
OC_Background
J
ob_ScheduledTask
::
all
();
foreach
(
$scheduled_tasks
as
$task
){
call_user_func
(
array
(
$task
[
'klass'
],
$task
[
'method'
]
),
$task
[
'parameters'
]
);
OC_Background
j
ob
s
_ScheduledTask
::
delete
(
$task
[
'id'
]
);
OC_Background
J
ob_ScheduledTask
::
delete
(
$task
[
'id'
]
);
}
return
true
;
...
...
@@ -67,7 +67,7 @@ class OC_Backgroundjobs_Worker{
$lasttask
=
OC_Appconfig
::
getValue
(
'core'
,
'backgroundjobs_task'
,
''
);
// What's the next step?
$regular_tasks
=
OC_Background
j
ob
s
_RegularTask
::
all
();
$regular_tasks
=
OC_Background
J
ob_RegularTask
::
all
();
ksort
(
$regular_tasks
);
$done
=
false
;
...
...
@@ -87,12 +87,12 @@ class OC_Backgroundjobs_Worker{
}
}
else
{
$tasks
=
OC_Background
j
ob
s
_ScheduledTask
::
all
();
$tasks
=
OC_Background
J
ob_ScheduledTask
::
all
();
if
(
length
(
$tasks
)){
$task
=
$tasks
[
0
];
// delete job before we execute it. This prevents endless loops
// of failing jobs.
OC_Background
j
ob
s
_ScheduledTask
::
delete
(
$task
[
'id'
]);
OC_Background
J
ob_ScheduledTask
::
delete
(
$task
[
'id'
]);
// execute job
call_user_func
(
array
(
$task
[
'klass'
],
$task
[
'method'
]
),
$task
[
'parameters'
]
);
...
...
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