Skip to content

Commit 2c1d672

Browse files
committed
Fix error when a not yet inserted job is updated
1 parent 738ba9f commit 2c1d672

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

spec/CloudCode.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,9 @@ describe('Cloud Code', () => {
15491549
describe('cloud jobs', () => {
15501550
it('should define a job', done => {
15511551
expect(() => {
1552-
Parse.Cloud.job('myJob', () => {});
1552+
Parse.Cloud.job('myJob', ({ message }) => {
1553+
message('Hello, world!!!');
1554+
});
15531555
}).not.toThrow();
15541556

15551557
request({

src/StatusHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function statusHandler(className, database) {
4141

4242
function update(where, object) {
4343
lastPromise = lastPromise.then(() => {
44-
return database.update(className, where, object);
44+
return database.update(className, where, object, { upsert: true });
4545
});
4646
return lastPromise;
4747
}

0 commit comments

Comments
 (0)