lesander / magister-calendar

:date: Automatically plan your Magister appointments in your Google calendar.
https://git.io/magister
MIT License
11 stars 6 forks source link

DeprecationWarning: Calling an asynchronous function without callback is deprecated. #35

Open CemreSuler opened 6 years ago

CemreSuler commented 6 years ago

I get this error every time I run the script, the calendar works fine, but this thing is just irritating

lesander commented 6 years ago

Could you please share the full output you see?

CemreSuler commented 6 years ago

Terminal.txt

jvdoorn commented 6 years ago

If it works fine you can just ignore it, if you are bothered by the output you can try the following (I'm on Mac, it will probably work on Linux but I'm not sure about Windows): your command > /dev/null For me it is the following: /usr/local/bin/node magister-calendar.js > /dev/null

I have a cron job that runs every 10 minutes or something which is what I'd recommend to you as well (of course you can use a different timeout and if cron is not available for your machine just use a similar piece of software).

CemreSuler commented 6 years ago

Thank you!

lesander commented 5 years ago

My bad. Somewhere in the codebase I've called an async function without giving a callback function. I'll see if I can find the exact culprit.

On a side note: I don't recommend writing the output of the program to /dev/null, since this will prevent you from seeing any logs.

Generally, this error message can be ignored.

lesander commented 5 years ago

@CemreSuler Could you please run magister-calendar.js with the following flags: --trace-warnings or --trace-deprecation and share the output?

jvdoorn commented 5 years ago

Alright, I see two errors in here:

[!] 9:49:42 2705581 Error creating appointment. {"errors":[{"domain":"global","reason":"duplicate","message":"The requested identifier already exists."}],"code":409,"message":"The requested identifier already exists."}
[*] 9:49:42 2705581 Appointment is a duplicate, updating instead.

and

(node:96131) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

The first one I think is from clearing a cache manually, I don't think it is neccesary to investigate the issue further.

The second issue is most likely fixed in my PR that replaces the asyncronious function with a syncronious function #39.