Coder Social home page Coder Social logo

chartmogul_test's Introduction

Installation

bundle install

Run

./bin/exporter --report-dir examples

Tests

bundle exec rspec

Task 1

The number will be any greater or equal than 100. It happens because operator select take the random ready channel and it can be ticker.C few times until select does not choose stopCh. To fix it we can prioritise select splitting it on two and use default case:

select {
    case <-stopCh:
        return
    default:
}
select {
    case <-ticker.C:
}

Task 2

I suggest changing the type of uuid column from text to uuid type and create indexes for external_id, uuid, another_id. The last one require because when there will be cascade deleting then it will scan the table for searching another_id.

Task 3

When we use some external API we need to worry about several things. First, it's a rate limit and pool of connections. Second, it's response errors.

With parallel importing, there can be a problem with sending the same request on create/retrieve customers and plans. There can be a performance problem and also a race condition problem. To avoid this we can use a runner with shared memory and mutex for updating this memory from workers. There can be also another solution and it really depends on how many reports we would like to import.

chartmogul_test's People

Contributors

vad4msiu avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.