src/server/server.py
def on_add_heat():
    '''Adds the next available heat number to the database.'''
    new_heat = Database.Heat(class_id=Database.CLASS_ID_NONE, cacheStatus=Results.CacheStatus.INVALID)
    DB.session.add(new_heat)
    DB.session.flush()
    DB.session.refresh(new_heat)

    for node in range(RACE.num_nodes): # Add next heat with empty pilots
        DB.session.add(Database.HeatNode(heat_id=new_heat.id, node_index=node, pilot_id=Database.PILOT_ID_NONE))

    DB.session.commit()

    Events.trigger(Evt.HEAT_DUPLICATE, {
        'heat_id': new_heat.id,
        })

    logger.info('Heat added: Heat {0}'.format(new_heat.id))
    emit_heat_data()
Adds the next available heat number to the database.
Adds the next available heat number to the database.
Adds the next available heat number to the database .
def on_add_heat():
    new_heat = Database.Heat(class_id=Database.CLASS_ID_NONE, cacheStatus=Results.CacheStatus.INVALID)
    DB.session.add(new_heat)
    DB.session.flush()
    DB.session.refresh(new_heat)
    for node in range(RACE.num_nodes): 
        DB.session.add(Database.HeatNode(heat_id=new_heat.id, node_index=node, pilot_id=Database.PILOT_ID_NONE))
    DB.session.commit()
    Events.trigger(Evt.HEAT_DUPLICATE, {
        'heat_id': new_heat.id,
        })
    logger.info('Heat added: Heat {0}'.format(new_heat.id))
    emit_heat_data()
def on_add_heat ( ) : new_heat = Database . Heat ( class_id = Database . CLASS_ID_NONE , cacheStatus = Results . CacheStatus . INVALID ) DB . session . add ( new_heat ) DB . session . flush ( ) DB . session . refresh ( new_heat ) for node in range ( RACE . num_nodes ) : DB . session . add ( Database . HeatNode ( heat_id = new_heat . id , node_index = node , pilot_id = Database . PILOT_ID_NONE ) ) DB . session . commit ( ) Events . trigger ( Evt . HEAT_DUPLICATE , { 'heat_id' : new_heat . id , } ) logger . info ( 'Heat added: Heat {0}' . format ( new_heat . id ) ) emit_heat_data ( )
Adds the next available heat number to the database.
Adds the next available heat number to the database .
'''Adds the next available heat number to the database.''' # Add next heat with empty pilots