Commit 83217de3 authored by Kevin Deldycke's avatar Kevin Deldycke

4th patch; See http://svn.erp5.org/?rev=9230&view=rev for details

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11930 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 21b126b1
...@@ -6,7 +6,7 @@ __version__ = 'TimerServer for Zope 0.1' ...@@ -6,7 +6,7 @@ __version__ = 'TimerServer for Zope 0.1'
import traceback import traceback
import thread import thread
import sys, os, errno, time, socket import sys, os, errno, time, socket, urllib
from StringIO import StringIO from StringIO import StringIO
from zLOG import LOG, INFO from zLOG import LOG, INFO
...@@ -14,7 +14,6 @@ from ZServer.PubCore import handle ...@@ -14,7 +14,6 @@ from ZServer.PubCore import handle
from ZPublisher.BaseRequest import BaseRequest from ZPublisher.BaseRequest import BaseRequest
from ZPublisher.BaseResponse import BaseResponse from ZPublisher.BaseResponse import BaseResponse
from ZPublisher.HTTPRequest import HTTPRequest from ZPublisher.HTTPRequest import HTTPRequest
from ZPublisher import Client
class TimerServer: class TimerServer:
def __init__(self, module, interval=600): def __init__(self, module, interval=600):
...@@ -36,7 +35,6 @@ class TimerServer: ...@@ -36,7 +35,6 @@ class TimerServer:
'\tInterval: %s seconds.\n'%(time.ctime(time.time()), interval)) '\tInterval: %s seconds.\n'%(time.ctime(time.time()), interval))
def run(self): def run(self):
# wait until the zhttp_server exist in socket_map # wait until the zhttp_server exist in socket_map
# because TimerService has to be started after the Zope HTTPServer # because TimerService has to be started after the Zope HTTPServer
from asyncore import socket_map from asyncore import socket_map
...@@ -59,8 +57,8 @@ class TimerServer: ...@@ -59,8 +57,8 @@ class TimerServer:
while 1: while 1:
time.sleep(5) time.sleep(5)
try: try:
Client.call('http://%s:%s' %(ip, port)) urllib.urlopen('http://%s:%s' %(ip, port))
except ValueError: except IOError:
continue continue
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment