Skip to content

manually clear key when Transient Errors encounted?  #61

@luckydrq

Description

@luckydrq

The README says:

Transient Errors: A load may fail because it simply can't be loaded (a permanent issue) or it may fail because of a transient issue such as a down database or network issue. For transient errors, clear the cache:

and gives an code snippet on how to deal with this situation:

userLoader.load(1).catch(error => {
  if (/* determine if error is transient */) {
    userLoader.clear(1);
  }
  throw error;
});

It is recommended to do clear(key) manually. But after i read the code, it seems that DataLoader already take care of this. Am i missing something or the doc need to update?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions