Skip to content
Snippets Groups Projects
Commit dedf939b authored by Tim Fesenko's avatar Tim Fesenko Committed by GitHub
Browse files

Merge pull request #1021 from steemit/web-push-notifications-update

Web push notifications update
parents 298c9ee2 560dd09f
No related branches found
No related tags found
No related merge requests found
...@@ -21,13 +21,13 @@ function notify(account, nparams, title, body, url, pic) { ...@@ -21,13 +21,13 @@ function notify(account, nparams, title, body, url, pic) {
} }
async function process_queue() { async function process_queue() {
console.log('-- processing web push notifications queue -->');
try { try {
const queue = await Tarantool.instance().call('webpush_get_delivery_queue'); const queue = await Tarantool.instance().call('webpush_get_delivery_queue');
console.log('processing web push notifications queue, length: ', queue.length);
for (const n of queue) { for (const n of queue) {
if (n.length === 0) return; if (n.length === 0) return;
const [account, nparams_array, title, body, url, pic] = n; const [account, nparams_array, title, body, url, pic] = n;
console.log('-- notification -->', account, body, url, pic); console.log('notification: ', account, body, url, pic);
for (const nparams of nparams_array) { for (const nparams of nparams_array) {
try { try {
await notify(account, nparams, title, body, url, pic); await notify(account, nparams, title, body, url, pic);
...@@ -35,7 +35,6 @@ async function process_queue() { ...@@ -35,7 +35,6 @@ async function process_queue() {
console.error('-- error in notify -->', account, err); console.error('-- error in notify -->', account, err);
} }
} }
break;
} }
// console.log('-- run.run -->', queue); // console.log('-- run.run -->', queue);
} catch (error) { } catch (error) {
...@@ -50,4 +49,3 @@ function run() { ...@@ -50,4 +49,3 @@ function run() {
} }
run(); run();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment