Ejemplo n.º 1
0
def main(configFile):
    from celery.bin import celeryd
    from j25.scripts import Server
    print Server.getBanner()
    logger = logging.getLogger("j25")
    logger.debug("Started with argv=%s", str(sys.argv))    
    if configFile:
        from j25.Configuration import Configuration
        config = Configuration.load_file(configFile)
    else:
        config = Configuration.load_defaults()
    
    import j25
#    if config.main.mode == "DEV":
#        Importer.enable()
#        j25._reloader = Reloader(0.6)
#        j25._reloader.start()
#        logger.warning("\033[1;31mDEVELOPMENT MODE ACTIVE\033[0m")

    logger.info("\033[1;33mProject: %s\033[0m", config.main.project_name)    
    #setting configuration global
    j25.config = config
    
    #init store
    logger.debug("Connecting to Database")
    j25.initStore()
    
    celeryd.main()
Ejemplo n.º 2
0
 def test_main(self):
     p, cd.Worker = cd.Worker, Worker
     s, sys.argv = sys.argv, ["celeryd", "--discard"]
     try:
         cd.main()
     finally:
         cd.Worker = p
         sys.argv = s
def main():
    """
    Runs Celeryd
    """
    if not os.path.exists(os.path.join(dname, 'celeryconfig.py')):
        print "celeryconfig.py file does not exist!. You must symlink it!"
        return 1
    else:
        sys.argv.append('--loglevel=INFO')
        celeryd.main()
        return 0
Ejemplo n.º 4
0
 def handle(self, *args, **options):
     """Handle the management command."""
     if not isinstance(options.get('loglevel'), int):
         options['loglevel'] = LOG_LEVELS[options.get('loglevel').upper()]
     main(concurrency=options.get('concurrency'),
          daemon=options.get('daemon'),
          logfile=options.get('logfile'),
          discard=options.get('discard'),
          loglevel=options.get('loglevel'),
          pidfile=options.get('pidfile'),
          queue_wakeup_after=options.get('queue_wakeup_after'))