Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in EpicGames cron job #36

Closed
targos opened this issue Aug 6, 2021 · 5 comments
Closed

Error in EpicGames cron job #36

targos opened this issue Aug 6, 2021 · 5 comments

Comments

@targos
Copy link
Member

targos commented Aug 6, 2021

TypeError: Cannot read property 'startDate' of undefined
    at /app/build/src/crons/EpicGames.js:87:77
    at Array.filter (<anonymous>)
    at getOfferedGames (/app/build/src/crons/EpicGames.js:86:36)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Cron.handle [as handler] (/app/build/src/crons/EpicGames.js:23:23)
    at async Cron.executeJob (/app/build/src/framework/Cron.js:28:13)
@Mesteery
Copy link
Member

Mesteery commented Aug 6, 2021

{
  elements: [
    {
      title: 'A Plague Tale: Innocence',
      price: {
        totalPrice: { fmtPrice: { originalPrice: '39,99 €' } },
        lineOffers: [
          {
            appliedRules: [
              {
                startDate: '2021-08-05T15:00:00.000Z',
                endDate: '2021-08-12T15:00:00.000Z'
              }
            ]
          }
        ]
      }
    },
    {
      title: 'Minit',
      price: {
        totalPrice: { fmtPrice: { originalPrice: '9,99 €' } },
        lineOffers: [
          {
            appliedRules: [
              {
                startDate: '2021-08-05T15:00:00.000Z',
                endDate: '2021-08-12T15:00:00.000Z'
              }
            ]
          }
        ]
      }
    }
  ],
}

Pourtant elements[0|1].price.lineOffers[0].appliedRules[0].startDate est bien défini

@targos
Copy link
Member Author

targos commented Aug 6, 2021

il ne l'était peut-être pas au moment où le bot a fait la requête

@Mesteery
Copy link
Member

Mesteery commented Aug 6, 2021

Certainement, mais dans ce cas c'est assez bizarre, il faudrait attendre 17h00 pour voir si cela se reproduit

@targos
Copy link
Member Author

targos commented Aug 6, 2021

vu qu'on fait la requête seulement une fois par jour, je ne suis pas contre le fait d'ajouter un log du résultat

targos added a commit that referenced this issue Aug 8, 2021
@targos
Copy link
Member Author

targos commented Aug 8, 2021

#37

targos added a commit that referenced this issue Aug 8, 2021
targos added a commit that referenced this issue Aug 8, 2021
targos added a commit that referenced this issue Aug 8, 2021
@targos targos closed this as completed Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants