Skip to content

Call queueing does not work #81

@spearmootz

Description

@spearmootz

Describe the bug
Api is not called, or at least fm doesnt seem to respond like it

Expected behavior
api is supposed to be called.

Code Examples

this never finished

const marpat = require("marpat");
const fmsApiClient = require("fms-api-client");


(async () => {

    await marpat.connect('nedb://memory');
    const client = fmsApiClient.Filemaker.create({
        //Credentials
        concurrency: 10
    });
    await client.save();

    const promises = [];
    let x = 0;
    while (x < 10) {
       
        try {
          promises.push ( 
            client.create('Accounts Data API Test | Data API', {account_number: x++ })
            )
        } catch (error) {
            console.error(error);
        }
    }
    console.log('called all');
    await Promise.all(promises);
    console.log('done');
})()

but if we change

promises.push ( 
            client.create('Accounts Data API Test | Data API', {account_number: x++ })
            )

to

            await client.create('Accounts Data API Test | Data API', {account_number: x++ })

it creates all but slow

Tests
i will attempt to do so

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions