projects
/
Pman.Base
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
76e3aa4
)
add lock code
author
Alan
<alan@roojs.com>
Wed, 3 Apr 2024 03:44:36 +0000
(11:44 +0800)
committer
Alan
<alan@roojs.com>
Wed, 3 Apr 2024 03:44:36 +0000
(11:44 +0800)
Pman.php
patch
|
blob
|
history
diff --git
a/Pman.php
b/Pman.php
index
97b7513
..
3c4c119
100644
(file)
--- a/
Pman.php
+++ b/
Pman.php
@@
-548,9
+548,27
@@
class Pman extends HTML_FlexyFramework_Page
}
}
+ /**
+ * while doing batch processes, the database sometimes get's locked up.
+ * if we are doing another batch process that can be avoided - we should just stop for a while..
+ */
-
-
+ function database_is_locked()
+ {
+ $cd = DB_DataObject::Factory('core_enum');
+ $cd->query("show processlist");
+ $cd->find();
+ $locked = 0;
+ while ($cd->fetch()) {
+ if ($cd->State == 'Waiting for table metadata lock') {
+ $locked++;
+ }
+ if ($locked> 10) {
+ return true;
+ }
+ }
+ return false;
+ }