MCPcopy Index your code
hub / github.com/parse-community/parse-server / enqueue

Method enqueue

src/Push/PushQueue.js:26–64  ·  view source on GitHub ↗
(body, where, config, auth, pushStatus)

Source from the content-addressed store, hash-verified

24 }
25
26 enqueue(body, where, config, auth, pushStatus) {
27 const limit = this.batchSize;
28
29 where = applyDeviceTokenExists(where);
30
31 // Order by objectId so no impact on the DB
32 const order = 'objectId';
33 return Promise.resolve()
34 .then(() => {
35 return rest.find(config, auth, '_Installation', where, {
36 limit: 0,
37 count: true,
38 });
39 })
40 .then(({ results, count }) => {
41 if (!results || count == 0) {
42 return pushStatus.complete();
43 }
44 pushStatus.setRunning(Math.ceil(count / limit));
45 let skip = 0;
46 while (skip < count) {
47 const query = {
48 where,
49 limit,
50 skip,
51 order,
52 };
53
54 const pushWorkItem = {
55 body,
56 query,
57 pushStatus: { objectId: pushStatus.objectId },
58 applicationId: config.applicationId,
59 };
60 this.parsePublisher.publish(this.channel, JSON.stringify(pushWorkItem));
61 skip += limit;
62 }
63 });
64 }
65}

Callers 6

updateFunction · 0.45
getMethod · 0.45
putMethod · 0.45
delMethod · 0.45
clearMethod · 0.45
sendPushMethod · 0.45

Calls 3

applyDeviceTokenExistsFunction · 0.90
findMethod · 0.65
publishMethod · 0.65

Tested by

no test coverage detected