consolidate more into outbound queue
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 30s
Details
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 30s
Details
This commit is contained in:
parent
de4ce0da5e
commit
c497b55294
|
@ -1,6 +1,6 @@
|
|||
const { proposals } = require('../util/contracts');
|
||||
const read = require('../api/read');
|
||||
const { sendNewProposalEvent } = require('../matrix-bot');
|
||||
const { sendNewProposalEvent } = require('../matrix-bot/outbound-queue');
|
||||
|
||||
// Subscribe to proposal events
|
||||
const start = () => {
|
||||
|
@ -19,6 +19,8 @@ const start = () => {
|
|||
if (post.embeddedData && Object.entries(post.embeddedData).length) {
|
||||
message += `\n\n${JSON.stringify(post.embeddedData, null, 2)}`;
|
||||
}
|
||||
|
||||
// The outbound queue handles deduplication
|
||||
sendNewProposalEvent(proposalIndex, message);
|
||||
});
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@ const cryptoProvider = new RustSdkCryptoStorageProvider(BOT_CRYPTO_STORAGE_PATH)
|
|||
let client;
|
||||
let joinedRooms;
|
||||
|
||||
const { outboundQueue, startOutboundQueue } = require('./outbound-queue');
|
||||
const { startOutboundQueue } = require('./outbound-queue');
|
||||
|
||||
const start = async () => {
|
||||
console.log('MATRIX_HOMESERVER_URL:', MATRIX_HOMESERVER_URL);
|
||||
|
@ -50,11 +50,6 @@ const start = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const sendNewProposalEvent = (proposalIndex, text) => {
|
||||
outboundQueue.push({ type: 'NewProposal', proposalIndex, text });
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
start,
|
||||
sendNewProposalEvent,
|
||||
};
|
||||
|
|
|
@ -42,8 +42,13 @@ const startOutboundQueue = (c) => {
|
|||
outboundQueue.resume();
|
||||
};
|
||||
|
||||
const sendNewProposalEvent = (proposalIndex, text) => {
|
||||
outboundQueue.push({ type: 'NewProposal', proposalIndex, text });
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
setTargetRoomId,
|
||||
outboundQueue,
|
||||
startOutboundQueue,
|
||||
sendNewProposalEvent,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue