Python threading.Timer函数不使用';不要等待';n';引发异常前的秒数

Python threading.Timer函数不使用';不要等待';n';引发异常前的秒数,python,timeout,weblogic,jython,wlst,Python,Timeout,Weblogic,Jython,Wlst,我试图弄明白为什么计时器不等待300秒,而是立即引发异常。有人能帮我解决这个问题吗?谢谢 这是我的密码: import sys import os from java.lang import System import getopt import time as systime from threading import Timer import time [...] def _startServer(ServerName): cd('domainRuntime:/ServerLi

我试图弄明白为什么计时器不等待300秒,而是立即引发异常。有人能帮我解决这个问题吗?谢谢

这是我的密码:

import sys
import os
from java.lang import System
import getopt
import time as systime
from threading import Timer
import time

[...]

def _startServer(ServerName):

    cd('domainRuntime:/ServerLifeCycleRuntimes/'+ServerName);
    state=_serverstatus(ServerName);

    while (state!='RUNNING'):

        try:
            cmo.start();
            while (state!='RUNNING'):
                state=_serverstatus(ServerName);
                java.lang.Thread.sleep(1000);

                t = threading.Timer(300.0,timeout)
                t.start()

        except:
            print 'Error in getting current status of ' +ServerName+ '\n';
            print 'Please check logged in user has full access to complete the start operation on ' +ServerName+ '\n';
            print 'Timeout, NodeManager may be down. Checking... ' + '\n';

            os.popen('sh /home/oracle/scripts/logAnalytics.sh')
            systime.sleep(60)

            state=_serverstatus(ServerName);

[...]
结果是:

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

172.31.129.68:7001
Connecting to t3://172.31.129.68:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'cll5_domain'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.


Successfully connected to the domain

Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)
Server Server_2 is :SHUTDOWN
Trying To Start Server:Server_2...
Server Server_2 is :SHUTDOWN
Server Server_2 is :SHUTDOWN
Error in getting current status of Server_2

Please check logged in user has full access to complete the start operation on Server_2

Timeout, NodeManager may be down. Checking...

Server Server_2 is :SHUTDOWN
Server Server_2 is :SHUTDOWN
Error in getting current status of Server_2

Please check logged in user has full access to complete the start operation on Server_2

Timeout, NodeManager may be down. Checking...

Server Server_2 is :RUNNING
Disconnected from weblogic server: AdminServer


Exiting WebLogic Scripting Tool.
(请注意,在下一个进程开始之前,必须在屏幕上多次写入字符串“Server_2 is:SHUTDOWN”。大约60次,因为有一个while循环,每隔5秒打印一次服务器状态字符串,计时器为300秒。)

环境:Oracle Linux 6、Oracle Weblogic 11


非常感谢您的帮助。

可能还有其他错误。请在
中打印错误,但
除外。您可以在服务器2的生命周期操作期间使用此post:Error