mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-12 11:28:49 +00:00
Merge pull request #407 from annando/removed_lockpath
Deprecated parts removed
This commit is contained in:
commit
bb04495f5b
7 changed files with 118 additions and 232 deletions
|
@ -976,8 +976,8 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
|
|||
// create contact record
|
||||
q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `addr`, `alias`, `notify`, `poll`,
|
||||
`name`, `nick`, `photo`, `network`, `rel`, `priority`,
|
||||
`writable`, `blocked`, `readonly`, `pending` )
|
||||
VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, 0, 0, 0)",
|
||||
`location`, `about`, `writable`, `blocked`, `readonly`, `pending` )
|
||||
VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, 0, 0, 0)",
|
||||
intval($uid),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc($contact->url),
|
||||
|
@ -992,6 +992,8 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
|
|||
dbesc(NETWORK_PUMPIO),
|
||||
intval(CONTACT_IS_FRIEND),
|
||||
intval(1),
|
||||
dbesc($contact->location->displayName),
|
||||
dbesc($contact->summary),
|
||||
intval(1)
|
||||
);
|
||||
|
||||
|
@ -1014,15 +1016,6 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
|
|||
require_once('include/group.php');
|
||||
group_add_member($uid,'',$contact_id,$g[0]['def_gid']);
|
||||
}
|
||||
|
||||
if (DB_UPDATE_VERSION >= "1177")
|
||||
q("UPDATE `contact` SET `location` = '%s',
|
||||
`about` = '%s'
|
||||
WHERE `id` = %d",
|
||||
dbesc($contact->location->displayName),
|
||||
dbesc($contact->summary),
|
||||
intval($contact_id)
|
||||
);
|
||||
} else {
|
||||
$contact_id = $r[0]["id"];
|
||||
|
||||
|
|
|
@ -41,21 +41,23 @@ function pumpio_sync_run(&$argv, &$argc){
|
|||
}
|
||||
}
|
||||
|
||||
$lockpath = get_lockpath();
|
||||
if ($lockpath != '') {
|
||||
$pidfile = new pidfile($lockpath, 'pumpio_sync');
|
||||
if($pidfile->is_already_running()) {
|
||||
logger("Already running");
|
||||
if ($pidfile->running_time() > 9*60) {
|
||||
$pidfile->kill();
|
||||
logger("killed stale process");
|
||||
// Calling a new instance
|
||||
proc_run('php','addon/pumpio/pumpio_sync.php');
|
||||
// This is deprecated with the worker
|
||||
if (function_exists("get_lockpath")) {
|
||||
$lockpath = get_lockpath();
|
||||
if ($lockpath != '') {
|
||||
$pidfile = new pidfile($lockpath, 'pumpio_sync');
|
||||
if($pidfile->is_already_running()) {
|
||||
logger("Already running");
|
||||
if ($pidfile->running_time() > 9*60) {
|
||||
$pidfile->kill();
|
||||
logger("killed stale process");
|
||||
// Calling a new instance
|
||||
proc_run('php','addon/pumpio/pumpio_sync.php');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
pumpio_sync($a);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue