@@ -3,13 +3,14 @@ import axiosRetry from "axios-retry";
33import { partition } from "lodash" ;
44import LRUCache from "lru-cache" ;
55import moment from "moment" ;
6- import { castleDkpTokenRO , dkpBonusesChannelId } from "../config" ;
6+ import { castleDkpTokenRO } from "../config" ;
77import {
88 AdjustmentData ,
99 RaidTick ,
1010 UPLOAD_DATE_FORMAT ,
1111} from "../features/dkp-records/raid-tick" ;
1212import { MINUTES , MONTHS } from "../shared/time" ;
13+ import { castledkp2 } from "./castledkp2" ;
1314
1415const route = ( f : string ) => `api.php?function=${ f } ` ;
1516
@@ -163,7 +164,10 @@ export const castledkp = {
163164 raid_note : `${ name } ${ threadUrl } ` ,
164165 } ;
165166 console . log ( "Creating new raid:" , payload ) ;
166- const { data } = await client . post < { raid_id : number } > ( route ( "add_raid" ) , payload ) ;
167+ const { data } = await client . post < { raid_id : number } > (
168+ route ( "add_raid" ) ,
169+ payload
170+ ) ;
167171
168172 return {
169173 eventUrlSlug : event . name
@@ -203,7 +207,10 @@ export const castledkp = {
203207 raid_note : `${ tick . name } ${ threadUrl } ` ,
204208 } ;
205209 console . log ( "Creating raid tick" , payload ) ;
206- const { data } = await client . post < { raid_id : number } > ( route ( "add_raid" ) , payload ) ;
210+ const { data } = await client . post < { raid_id : number } > (
211+ route ( "add_raid" ) ,
212+ payload
213+ ) ;
207214
208215 // add items to raid
209216 console . log ( "Adding items to raid" , tick . data . loot ) ;
@@ -219,6 +226,12 @@ export const castledkp = {
219226 ) || [ ]
220227 ) ;
221228
229+ // Temporarily create data using the beta service as well; this is not async and is fault tolerant.
230+ // Primarily, this is being used to test the beta service by ingesting real data.
231+ castledkp2 . createRaid ( tick ) . catch ( ( error ) => {
232+ console . log ( `Failed to create raid in beta service: ${ error } ` ) ;
233+ } ) ;
234+
222235 return {
223236 eventUrlSlug : tick . data . event . name
224237 . toLowerCase ( )
0 commit comments