Closed 0rangeFox closed 2 years ago
Thanks for reporting. I'll have to ask an-tao for that.
BTW, MSYS2 have updated to GCC 11.2. Hopefully you can have coroutines working now
It has been a long time, so maybe the problem has already been solved. If not, I will reopen this issue with more detailed information.
Well the problem is already described on title. Whenever I start the server, it always returns null, but after spamming some requests it starts to come with values, and after that it sometimes starts to come null or with values, and it's only happening in that column "subscriptionExpiresAt" at the moment.
Logs:
```bash root@UserFilter.h:
```cpp #pragma once #includeUserFilter.cc:
```cpp #include "UserFilter.h" using namespace v1::filters; void UserFilter::doFilter(const HttpRequestPtr &request, FilterCallback &&fcb, FilterChainCallback &&fccb) { if (!*_dbClient) *_dbClient = app().getFastDbClient(); (*_dbClient)->execSqlAsync("SELECT u.id, u.first_name, u.last_name, u.email, u.password, u.image, u.billing_address, u.shipping_address, u.mobile_number, u.enabled, IFNULL(s.hasSubscription, FALSE) AS hasSubscription, s.subscriptionExpiresAt FROM users u LEFT OUTER JOIN (SELECT s.id_user, CASE WHEN COUNT(s.id) > 0 THEN TRUE ELSE FALSE END AS hasSubscription, @expiresAt AS subscriptionExpiresAt FROM subscriptions s INNER JOIN plans p ON p.id = s.id_plan INNER JOIN payment_logs pl ON pl.id = s.id_payment_log WHERE pl.completed IS NOT NULL AND TIMESTAMP(NOW()) BETWEEN pl.completed AND @expiresAt := TIMESTAMP(DATE_ADD(pl.completed, INTERVAL p.duration MINUTE)) ORDER BY @expiresAt DESC LIMIT 1) s ON s.id_user = u.id WHERE u.id = 5;", [request, fcb, fccb](const Result &result) { if (result.affectedRows() == 1) { // Verify if account ins't banned. if (!result[0][Users::Cols::_enabled].as