fix some things

This commit is contained in:
nora 2022-02-21 21:09:04 +01:00
parent b67c722c19
commit 6f5fef2f23
9 changed files with 55 additions and 55 deletions

View file

@ -1,7 +1,6 @@
import { connect } from 'amqplib';
import { sleep } from './utils/utils.js';
import {connectAmqp, sleep} from './utils/utils.js';
const connection = await connect('amqp://localhost');
const connection = await connectAmqp();
const channel = await connection.createChannel();

View file

@ -1,6 +1,6 @@
import { connect } from 'amqplib';
import {connectAmqp} from "./utils/utils.js";
const connection = await connect('amqp://localhost');
const connection = await connectAmqp();
const channel = await connection.createChannel();

View file

@ -1 +1,17 @@
import {connect} from "amqplib";
export const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
export const connectAmqp = async () => {
return connect({
protocol: 'amqp',
hostname: 'localhost',
port: 5672,
username: 'admin',
password: '',
frameMax: 238556565673829,
}, {
});
}