~vila/udd/split-failures

« back to all changes in this revision

Viewing changes to mass_import.py

  • Committer: Max Bowsher
  • Date: 2011-06-15 07:26:45 UTC
  • mto: This revision was merged to the branch mainline in revision 466.
  • Revision ID: _@maxb.eu-20110615072645-g21l03cw1a7wd0ol
Extract the threading-related portions of icommon to a new udd.threads.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from udd import icommon
19
19
from udd import iconfig
20
 
 
21
 
#import httplib2
22
 
#httplib2.debuglevel = 1
 
20
from udd.threads import (
 
21
        SubprocessMonitor,
 
22
        ThreadDriver,
 
23
        )
23
24
 
24
25
 
25
26
class WatchedFileHandler(logging.FileHandler):
129
130
                   ''.join(traceback.format_exception(exc_class, exc_value,
130
131
                                                      exc_tb))))
131
132
 
132
 
class Importer(icommon.SubprocessMonitor):
 
133
class Importer(SubprocessMonitor):
133
134
 
134
135
    def __init__(self, args, package_name, job_id):
135
136
        # FIXME: We should put the max_duration in a config file when it
223
224
                    self.tried = set()
224
225
 
225
226
 
226
 
class ImportDriver(icommon.ThreadDriver):
 
227
class ImportDriver(ThreadDriver):
227
228
    """Monitor the ThreadedImporter.
228
229
 
229
230
    This includes planning and spawning imports, tracking their success or
301
302
                # doing all the filesystem calls every milisecond but the user
302
303
                # shouldn't have to wait too long to see his modifications
303
304
                # taken into account either.
304
 
                self.driver.stopped.wait(0.2)
 
305
                self.driver.stopped.wait(5)
305
306
                if self.driver.stopped.isSet():
306
307
                    break
307
308
                # Then check the graceful stop file