Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Batch Size?

Discussion in 'Cloud Save' started by cryogee, Sep 27, 2022.

  1. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    I'm getting error when I push all local data to server on first login

    CloudSaveException: Batch size exceeded the limit

    Where can I find details of this batch size.

     
  2. MariusUrbelis

    MariusUrbelis

    Unity Technologies

    Joined:
    Mar 15, 2015
    Posts:
    29
  3. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    There is nothing mentioned in it about batch size. All limits mentioned there are within threshold

    This issue only occurs when I add 50+ items keys to Dictionary and then call
    await CloudSaveService.Instance.Data.ForceSaveAsync(dict);

    Ill try to test what is Max dictionary limit by brute force.
     
  4. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    Looks like batch size per dictionary is 20 items as tested by below code. Please update documentation so users can have ready reference to this information

    Code (CSharp):
    1. int batchsize =21;
    2.             Dictionary<string, object> dict = new Dictionary<string, object>();
    3.             for (int t=0;t<batchsize;t++)
    4.             {
    5.                 dict.Add("KEY_"+t, t);
    6.             }
    7.            
    8.             await CloudSaveService.Instance.Data.ForceSaveAsync(dict);
    9.             Debug.Log($"DONE  saved level");
     
    Niroan and DavidZobrist like this.
  5. MariusUrbelis

    MariusUrbelis

    Unity Technologies

    Joined:
    Mar 15, 2015
    Posts:
    29