modify node ci example
This commit is contained in:
parent
a94295f372
commit
6e5e98bbd4
|
@ -50,7 +50,7 @@ async function prepare() {
|
||||||
|
|
||||||
let createTopic = `CREATE TOPIC IF NOT EXISTS ${topics[0]} AS SELECT * FROM ${db}.${stable}`;
|
let createTopic = `CREATE TOPIC IF NOT EXISTS ${topics[0]} AS SELECT * FROM ${db}.${stable}`;
|
||||||
await wsSql.exec(createTopic);
|
await wsSql.exec(createTopic);
|
||||||
wsSql.close();
|
await wsSql.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function insert() {
|
async function insert() {
|
||||||
|
@ -63,7 +63,7 @@ async function insert() {
|
||||||
await wsSql.exec(`INSERT INTO d1001 USING ${stable} (location, groupId) TAGS ("California.SanFrancisco", 3) VALUES (NOW, ${10 + i}, ${200 + i}, ${0.32 + i})`);
|
await wsSql.exec(`INSERT INTO d1001 USING ${stable} (location, groupId) TAGS ("California.SanFrancisco", 3) VALUES (NOW, ${10 + i}, ${200 + i}, ${0.32 + i})`);
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
}
|
}
|
||||||
wsSql.close();
|
await wsSql.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function subscribe(consumer) {
|
async function subscribe(consumer) {
|
||||||
|
|
|
@ -96,7 +96,7 @@ async function consumer() {
|
||||||
console.log("Consumer unsubscribed successfully.");
|
console.log("Consumer unsubscribed successfully.");
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error(`Failed to unsubscribe consumer, topic: ${topic}, groupId: ${groupId}, clientId: ${clientId}, ErrCode: ${err.code}, ErrMessage: ${err.message}`);
|
console.error(`Failed to consumer, topic: ${topic}, groupId: ${groupId}, clientId: ${clientId}, ErrCode: ${err.code}, ErrMessage: ${err.message}`);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
Loading…
Reference in New Issue