Changeset 8624 for mauRepo


Ignore:
Timestamp:
10/10/12 13:41:45 (7 years ago)
Author:
mnagni
Message:

Complete - # 22566: Add Related Party type and indexing to new JSON object
 http://team.ceda.ac.uk/trac/ceda/ticket/22566
Complete - # 22562: CEDA MOLES3 Bug Report: Publication time missing
 http://team.ceda.ac.uk/trac/ceda/ticket/22562
Complete - # 22567: CEDA MOLES3 Bug Report: Info DB connection check needed
 http://team.ceda.ac.uk/trac/ceda/ticket/22567

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/cedaMoles/MolesManager/molesSessionMiddleware.py

    r8536 r8624  
    4343from django.shortcuts import render_to_response 
    4444from cedaMoles import __version__, __revision__ 
     45from logging import StreamHandler 
     46import logging 
     47 
     48log = logging.getLogger('MolesSessionMiddleware') 
     49log.addHandler(StreamHandler()) 
     50log.setLevel(logging.INFO)  
    4551 
    4652def assemble_version(): 
     
    6470     
    6571    def _doInitialization(self): 
    66  
    67         infoDB = DbManager(INFO_DB_CONNECTION) 
    68         MolesSessionMiddleware._infodbEPBFactory = InfodbEPBFactory(infoDB) 
     72        start_migration = False 
     73        try: 
     74            infoDB = DbManager(INFO_DB_CONNECTION) 
     75            MolesSessionMiddleware._infodbEPBFactory = InfodbEPBFactory(infoDB) 
     76            start_migration = True 
     77        except Exception: 
     78            log.info("Cannot initialize infoDB. The migration process will not start \ 
     79however the application will continue to browse the existing database.") 
    6980            
    7081        migrationDB = DbManager(MIGRATION_DB_CONNECTION, MIGRATION_DB_SCRIPT) 
     
    7485        MolesSessionMiddleware._moles3EPBFactory = Moles3EPBFactory(molesDB) 
    7586         
     87        MolesSessionMiddleware._epbInitialized = True 
     88         
     89        if not start_migration: 
     90            return 
     91         
    7692        MolesSessionMiddleware._migrationThread = MigrationThread( \ 
    7793            MolesSessionMiddleware._moles3EPBFactory.createEPB(), \ 
     
    7995            MolesSessionMiddleware._infodbEPBFactory.createEPB(), \ 
    8096            interval = MIGRATION_INTERVAL ) 
    81         MolesSessionMiddleware._epbInitialized = True       
     97               
    8298             
    8399        _migration() 
Note: See TracChangeset for help on using the changeset viewer.