mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 11:45:02 +01:00
fix some things
This commit is contained in:
parent
b67c722c19
commit
6f5fef2f23
9 changed files with 55 additions and 55 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}, {
|
||||
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue