# |
Mar 11th 2019, 16:07 |
neon1024 |
Add in some logging, check your performance, try siege, test with postman |
# |
Mar 11th 2019, 16:06 |
neon1024 |
What I would suggest would be to get started |
# |
Mar 11th 2019, 16:06 |
neon1024 |
This all sounds like you’ve no idea what’s going on and haven’t started your investigation yet |
# |
Mar 11th 2019, 16:05 |
david |
but I don't know if there is anything I could look for |
# |
Mar 11th 2019, 16:05 |
david |
it seems a server problem, not implementation |
# |
Mar 11th 2019, 16:05 |
david |
not only sometimes randomly... then, app begans to work fine, until the next time it goes slow |
# |
Mar 11th 2019, 16:04 |
david |
no crash, I mean... it should fails always |
# |
Mar 11th 2019, 16:04 |
neon1024 |
Well it wouldn’t crash, but your web service would probably return a code for missing OPTIONS verb |
# |
Mar 11th 2019, 16:03 |
david |
but it was a CORS problem, it should crash always, isn't it? |
# |
Mar 11th 2019, 16:03 |
david |
no, as far as I know |
# |
Mar 11th 2019, 16:01 |
neon1024 |
Then again, the app won’t be a browser I’d guess |
# |
Mar 11th 2019, 16:01 |
neon1024 |
Could be CORS |
# |
Mar 11th 2019, 16:01 |
neon1024 |
Are they doing pre-flight checks? |
# |
Mar 11th 2019, 15:52 |
david |
we have developed an API REST, which works really fast when requesting from postman. An IOS developer consumes the api from a native app, and it works really slow... sometimes. When it works, it works fine, but many times it exceeds the time. Is there any setup which I could check? It seems to be a problem from the app, not the api, but I don't know how to check this. Logs dir is empty. |
# |
Mar 11th 2019, 15:51 |
jeremyharris |
yea, use the second parameter of contain() to add to the query |
# |
Mar 11th 2019, 15:38 |
martin |
hmm if I have a hasone, relation, and I contain that one in query, can I give options for that finder method? |
# |
Mar 11th 2019, 15:22 |
tjkalinowski |
@martin nothing more comes to my mind. |
# |
Mar 11th 2019, 15:22 |
tjkalinowski |
@martin You have to add one filed to table, and then order by this filed. |
# |
Mar 11th 2019, 15:05 |
martin |
just-> |
# |
Mar 11th 2019, 15:02 |
martin |
ok, how do you do that? |
# |
Mar 11th 2019, 15:02 |
neon1024 |
I have a few places where I do that |
# |
Mar 11th 2019, 15:01 |
neon1024 |
It does |
# |
Mar 11th 2019, 14:59 |
martin |
ah it is possible in mysql: `select * from stores where id in(2,8,4) order by FIELD(`id`, 2, 8, 4);` so I think that should work in cake too, lets try :) |
# |
Mar 11th 2019, 14:53 |
martin |
Like I have to get 1 price of product_id with store_id one of 4,6,1 and the first one in that order |
# |
Mar 11th 2019, 14:52 |
martin |
hmm maybe I can fix this with a custom finder? but how can I order by a choosen order? :P |
# |
Mar 11th 2019, 14:37 |
martin |
like Walmart (not really walmart but I have to choose a name for now) international have a price for the country, but not all stores have the same price, they can change it |
# |
Mar 11th 2019, 14:36 |
ricksaccous |
that's tricky |
# |
Mar 11th 2019, 14:35 |
ricksaccous |
i seeee |
# |
Mar 11th 2019, 14:35 |
martin |
no Only one, but if that one does not have to price, the price of the first parent with price |
# |
Mar 11th 2019, 14:35 |
ricksaccous |
what do you mean by this: Now I’ve have to find the closest price by a product for the store |
# |
Mar 11th 2019, 14:35 |
ricksaccous |
i have no idea, do you need the prices of every store? |
# |
Mar 11th 2019, 14:34 |
martin |
hmm, but how can I contain all parents? |
# |
Mar 11th 2019, 14:33 |
ricksaccous |
you'll probably want to specify fields in the query in case things get too ugly |
# |
Mar 11th 2019, 14:32 |
ricksaccous |
i suppose so... |
# |
Mar 11th 2019, 14:32 |
martin |
hmm ok so then I always have to contain all parents of store with the prices |
# |
Mar 11th 2019, 14:31 |
ricksaccous |
you'll have to handle the situation where the models aren't contained though |
# |
Mar 11th 2019, 14:30 |
ricksaccous |
sounds like you'll have to contain multiple models and you can do the price logic in the entity if you want |
# |
Mar 11th 2019, 14:28 |
slackebot |
parent. I believe there is no default relation for that so that I can simple contain the price to query? |
# |
Mar 11th 2019, 14:28 |
martin |
Hello world! I’ve a question, I’ve a products database, and a database with prices per store. Stores are a tree. the group (or subgroup) of a store can have a price of a product, and we will have a price on group, or a direct on the store. Now I’ve have to find the closest price by a product for the store, So I have to search the tree up for the price, does store not have it, check if parent has it, does parent does not have a price chec |
# |
Mar 11th 2019, 14:27 |
neon1024 |
:drooling_face: |
# |
Mar 11th 2019, 14:27 |
neon1024 |
Stroopwaffel! |