#Database Async Stuff not running
1 messages · Page 1 of 1 (latest)
paste code i guess https://paste.md-5.net/
Willdo
A lot of the actual information is custom classes, but the actual load() method is just setting values
It can be found all the way at the bottom
abstract your database to a proper class
And that will fix the async operations not running issue?
uh no
i guess they are running
add some system.out lines under the code that you want to check if it ran
👍
but your values are updated async, that would mean if you try to access them from another thread, they might have been updated already or not, cuz databases are slow and the query can be still in progress
Ahhhh
I do have runnables though that call for userinformation, and its information that can be updated at any time..
i think your problem is the combination of sync/ async
is there any chance that your project is on github?
There is not, I really try to not share the code because it's "Staff Information", and I don't want to be the type of owner to break staff policies
hmm
I can share stuff, I just don't want to share what I don't have to
I'm confused however, the task is running and it is getting information and all that - the values just aren't being updated in the actual instance of Y_UserInfo
dont see any reason to call load() again after saving some user stuff to the database, as it saves it to the database and you immediately query the updated value back to set it locally
just do like this.receivingTpaRequests = VAL
conventions smh
instead of reloading stuff that isnt changed
abstract your database away from your userdata object
and call database.updateUser or smth whenever something changes locally
I see, so after someone toggles their displayrank to a different rank?
ye
What about my actionbar runnable, that displays shards and rank?
That stuff should just be updated de-facto, yes?
ye in the command, or just save users periodically java void onCommand(sender, stuff) { user.setRank(someRank); database.updateUser(); // async }
uhh actionbar runnable?
thats information that is present in the userdata no?
That's what I figured