lib/fetching/sourceToChannel.js
/**
 * Creates a Channel for each Source, starting
 * all Channels with an enabled Source.
 */
Creates a Channel for each Source, starting
all Channels with an enabled Source.
Creates a Channel for each Source starting all Channels with an enabled Source .
async function initChannels() {
    const fetching = isFetching();
    const sources = await Source
        .find({})
        .populate({ path: 'credentials' })
        .exec();
    sources.forEach((source) => createChannel(source));
    await downstream.start((_, channel) => fetching && channel.enabled);
}
async function initChannels ( ) { const fetching = isFetching ( ) ; const sources = await Source . find ( { } ) . populate ( { path : 'credentials' } ) . exec ( ) ; sources . forEach ( ( source ) => createChannel ( source ) ) ; await downstream . start ( ( _ , channel ) => fetching && channel . enabled ) ; }
Creates a Channel for each Source, starting
 all Channels with an enabled Source.
Creates a Channel for each Source starting all Channels with an enabled Source .
// create & start all enabled Channels