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
6ee2b4c7
Commit
6ee2b4c7
authored
11 years ago
by
Christopher Schäpers
Browse files
Options
Downloads
Patches
Plain Diff
No personal prefixes for variables.
parent
8d1db84e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cron.php
+11
-11
11 additions, 11 deletions
cron.php
with
11 additions
and
11 deletions
cron.php
+
11
−
11
View file @
6ee2b4c7
...
...
@@ -21,7 +21,7 @@
*/
// Unfortunately we need this class for shutdown function
class
my_t
emporary
_c
ron
_c
lass
{
class
T
emporary
C
ron
C
lass
{
public
static
$sent
=
false
;
public
static
$lockfile
=
""
;
public
static
$keeplock
=
false
;
...
...
@@ -30,12 +30,12 @@ class my_temporary_cron_class {
// We use this function to handle (unexpected) shutdowns
function
handleUnexpectedShutdown
()
{
// Delete lockfile
if
(
!
my_t
emporary
_c
ron
_c
lass
::
$keeplock
&&
file_exists
(
my_t
emporary
_c
ron
_c
lass
::
$lockfile
))
{
unlink
(
my_t
emporary
_c
ron
_c
lass
::
$lockfile
);
if
(
!
T
emporary
C
ron
C
lass
::
$keeplock
&&
file_exists
(
T
emporary
C
ron
C
lass
::
$lockfile
))
{
unlink
(
T
emporary
C
ron
C
lass
::
$lockfile
);
}
// Say goodbye if the app did not shutdown properly
if
(
!
my_t
emporary
_c
ron
_c
lass
::
$sent
)
{
if
(
!
T
emporary
C
ron
C
lass
::
$sent
)
{
if
(
OC
::
$CLI
)
{
echo
'Unexpected error!'
.
PHP_EOL
;
}
...
...
@@ -64,7 +64,7 @@ OC_Helper::cleanTmpNoClean();
// Exit if background jobs are disabled!
$appmode
=
OC_BackgroundJob
::
getExecutionType
();
if
(
$appmode
==
'none'
)
{
my_t
emporary
_c
ron
_c
lass
::
$sent
=
true
;
T
emporary
C
ron
C
lass
::
$sent
=
true
;
if
(
OC
::
$CLI
)
{
echo
'Background Jobs are disabled!'
.
PHP_EOL
;
}
...
...
@@ -76,7 +76,7 @@ if( $appmode == 'none' ) {
if
(
OC
::
$CLI
)
{
// Create lock file first
my_t
emporary
_c
ron
_c
lass
::
$lockfile
=
OC_Config
::
getValue
(
"datadirectory"
,
OC
::
$SERVERROOT
.
'/data'
)
.
'/cron.lock'
;
T
emporary
C
ron
C
lass
::
$lockfile
=
OC_Config
::
getValue
(
"datadirectory"
,
OC
::
$SERVERROOT
.
'/data'
)
.
'/cron.lock'
;
// We call ownCloud from the CLI (aka cron)
if
(
$appmode
!=
'cron'
)
{
...
...
@@ -85,15 +85,15 @@ if( OC::$CLI ) {
}
// check if backgroundjobs is still running
if
(
file_exists
(
my_t
emporary
_c
ron
_c
lass
::
$lockfile
))
{
my_t
emporary
_c
ron
_c
lass
::
$keeplock
=
true
;
my_t
emporary
_c
ron
_c
lass
::
$sent
=
true
;
if
(
file_exists
(
T
emporary
C
ron
C
lass
::
$lockfile
))
{
T
emporary
C
ron
C
lass
::
$keeplock
=
true
;
T
emporary
C
ron
C
lass
::
$sent
=
true
;
echo
"Another instance of cron.php is still running!"
;
exit
(
1
);
}
// Create a lock file
touch
(
my_t
emporary
_c
ron
_c
lass
::
$lockfile
);
touch
(
T
emporary
C
ron
C
lass
::
$lockfile
);
// Work
OC_BackgroundJob_Worker
::
doAllSteps
();
...
...
@@ -112,5 +112,5 @@ else{
}
// done!
my_t
emporary
_c
ron
_c
lass
::
$sent
=
true
;
T
emporary
C
ron
C
lass
::
$sent
=
true
;
exit
();
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