huridocs/uwazi

View on GitHub
scripts/emitSocketEvent.js

Summary

Maintainability
A
0 mins
Test Coverage
import { emitSocketEvent } from '../app/api/socketio/standaloneEmitSocketEvent';

const { tenant, event } = require('yargs')
  .option('tenant', {
    alias: 't',
    type: 'string',
    describe: 'tenant to send event to, defaults to all tenants.',
    default: '',
  })
  .option('event', {
    alias: 'e',
    type: 'string',
    describe: 'event name to sent to clients connected',
    choices: ['forceReconnect'],
  })
  .demandOption(['event'], '\n\n').argv;

emitSocketEvent(event, tenant, '');