From 536b38a27f5ca16e40eb3de4d1fd8e6f1d25e924 Mon Sep 17 00:00:00 2001 From: horus Date: Mon, 3 Jan 2022 14:55:31 +0100 Subject: Adding new users should be async. (Does not work yet.) --- app/Jobs/AddNewCalUser.php | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 app/Jobs/AddNewCalUser.php (limited to 'app/Jobs/AddNewCalUser.php') diff --git a/app/Jobs/AddNewCalUser.php b/app/Jobs/AddNewCalUser.php new file mode 100644 index 0000000..dfb74fe --- /dev/null +++ b/app/Jobs/AddNewCalUser.php @@ -0,0 +1,66 @@ +username = $username; + } + + /** + * Execute the job. + * + * @return void + */ + public function handle() + { + $helper = new Helper(); + $helper->createUser( $this->username ); + if ( false === $helper->setIsWatching( $this->username ) ) { + echo "fail!!!"; + #$this->setOutput(["status" => "fail", "reason" => "user does not exist", "username" => $this->username]); + $this->queueData(["status" => "fail", "reason" => "user does not exist", "username" => $this->username]); + + } else { + $helper->setCalendar( $this->username ); + #$this->setOutput(["status" => "okay", "reason" => "", "username" => $this->username]); + $this->queueData(["status" => "okay", "reason" => "", "username" => $this->username]); + } + + $this->fail(); + } + + /* + public function uniqueId() { + #return $this->username; + } + */ +} -- cgit v1.2.3