import Brands from '../../collections/brands.js';
import { check } from 'meteor/check';

import { Logger } from 'meteor/ostrio:logger';
import { LoggerFile } from 'meteor/ostrio:loggerfile';

var log = new Logger();
(new LoggerFile(log)).enable();

Meteor.publish("brands", function() {
    if (!this.userId) {
        return this.ready();
    }

    Meteor.settings.enableDebug ? log.debug(`brandPublisher => start publish brands `, {}, Meteor.user().username) : '';

    return Brands.find({}, {
        disableOplog: true,
        // pollingThrottleMs: 1000,
        pollingIntervalMs: 1000
    });
});