fixed a missing get_all_user_calls
[spider.git] / perl / cluster.pl
index 64cbab11ed1d6efc69ed2adc3f6896eb85ca8dee..d9827a651fc8daf635f886aae7ef1fd6dbfdf717 100755 (executable)
@@ -94,7 +94,7 @@ sub already_conn
        dbg('chan', "-> Z $call bye\n");
        $conn->send_now("Z$call|bye"); # this will cause 'client' to disconnect
        sleep(1);
-       $conn->disconnect;
+       $conn->disconnect();
 }
 
 # handle incoming messages
@@ -105,7 +105,7 @@ sub rec
        
        if (defined $err && $err) {
                if ($dxchan) {
-                       disconnect($dxchan);
+                       $dxchan->disconnect;
                }
                return;
        }
@@ -184,9 +184,9 @@ sub cease
        };
        dbg('local', "Local::finish error $@") if $@;
 
-       # disconnect users
+       # disconnect nodes
        foreach $dxchan (DXChannel->get_all()) {
-               next if $dxchan->is_ak1a;
+               next unless $dxchan->is_ak1a;
                disconnect($dxchan) unless $dxchan == $DXProt::me;
        }
        Msg->event_loop(1, 0.05);
@@ -196,9 +196,9 @@ sub cease
        Msg->event_loop(1, 0.05);
        Msg->event_loop(1, 0.05);
 
-       # disconnect nodes
+       # disconnect users
        foreach $dxchan (DXChannel->get_all()) {
-               next unless $dxchan->is_ak1a;
+               next if $dxchan->is_ak1a;
                disconnect($dxchan) unless $dxchan == $DXProt::me;
        }
        Msg->event_loop(1, 0.05);
@@ -207,12 +207,6 @@ sub cease
        Msg->event_loop(1, 0.05);
        Msg->event_loop(1, 0.05);
        Msg->event_loop(1, 0.05);
-       Msg->event_loop(1, 0.05);
-       Msg->event_loop(1, 0.05);
-       Msg->event_loop(1, 0.05);
-       Msg->event_loop(1, 0.05);
-       Msg->event_loop(1, 0.05);
-       Msg->event_loop(1, 0.05);
        DXUser::finish();
 
        # close all databases