Scheduler cleanup

This commit is contained in:
Romain Neutron
2013-10-03 16:57:28 +02:00
parent c4a9f99c35
commit 3f81474c4b
2 changed files with 0 additions and 86 deletions

View File

@@ -30,24 +30,6 @@ class phrasea
const CACHE_SBAS_FROM_BAS = 'sbas_from_bas';
const CACHE_SBAS_PARAMS = 'sbas_params';
public static function is_scheduler_started(Application $app)
{
$retval = false;
$conn = connection::getPDOConnection($app);
$sql = 'SELECT schedstatus FROM sitepreff';
$stmt = $conn->prepare($sql);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
if ($row && $row['schedstatus'] != 'stopped') {
$retval = true;
}
return $retval;
}
public static function clear_sbas_params(Application $app)
{
self::$_sbas_params = null;
@@ -286,32 +268,4 @@ class phrasea
return 'Unknown collection';
}
public static function scheduler_key(Application $app, $renew = false)
{
$conn = connection::getPDOConnection($app);
$schedulerkey = false;
$sql = 'SELECT schedulerkey FROM sitepreff';
$stmt = $conn->prepare($sql);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
if ($row) {
$schedulerkey = trim($row['schedulerkey']);
}
if ($renew === true || $schedulerkey == '') {
$schedulerkey = random::generatePassword(20);
$sql = 'UPDATE sitepreff SET schedulerkey = :scheduler_key';
$stmt = $conn->prepare($sql);
$stmt->execute(array(':scheduler_key' => $schedulerkey));
$stmt->closeCursor();
}
return $schedulerkey;
}
}

View File

@@ -2293,43 +2293,6 @@
<default>0000-00-00 00:00:00</default>
<comment></comment>
</field>
<field>
<name>schedstatus</name>
<type>enum('stopped','stopping','started','tostop')</type>
<null></null>
<extra></extra>
<default>stopped</default>
<comment></comment>
<collation>ascii_bin</collation>
</field>
<field>
<name>schedqtime</name>
<type>datetime</type>
<null></null>
<extra></extra>
<default>0000-00-00 00:00:00</default>
<comment></comment>
</field>
<field>
<name>schedpid</name>
<type>int(11)</type>
<null>YES</null>
<extra></extra>
<default></default>
<comment></comment>
</field>
<field>
<name>schedulerkey</name>
<type>char(20)</type>
<null>YES</null>
<extra></extra>
<default></default>
<comment></comment>
</field>
</fields>
<indexes>
<index>
@@ -2355,9 +2318,6 @@
</data>
<data key="version"></data>
<data key="maj">0000-00-00</data>
<data key="schedstatus">stopped</data>
<data key="schedqtime"></data>
<data key="schedpid"></data>
</default>
</defaults>
<engine>InnoDB</engine>