@@ -40,6 +40,7 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
4040
4141 if ( gamesResponse . success ) {
4242 const games = gamesResponse . data as unknown as Game [ ]
43+ log ( `[autopost] found games` , games . length , 'info' )
4344
4445 for ( const game of games ) {
4546 const autoPostSetting =
@@ -48,10 +49,10 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
4849 : 0
4950
5051 if ( autoPostSetting === 0 ) {
51- log ( 'autopost not set, skipping game' , game . name )
52+ log ( '[ autopost] autoposting not set, skipping game' , game . name )
5253 continue
5354 } else {
54- log ( `autopost set to ${ autoPostSetting } minutes, checking game` , game . name , 'info' )
55+ log ( `[autopost] autopost set to ${ autoPostSetting } minutes, checking game` , game . name , 'info' )
5556 }
5657
5758 const thisGameConfig = {
@@ -68,7 +69,7 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
6869 const activeQueue = await getActiveQueueForGame ( game , nonAdminBiketag )
6970
7071 if ( activeQueue . completedTags . length && activeQueue . timedOutTags . length === 0 ) {
71- log ( 'completed tags found but none timed out' , { game, activeQueue } , 'info' )
72+ log ( '[autopost] completed tags found but none timed out' , { game, activeQueue } , 'info' )
7273 } else if ( activeQueue . completedTags . length && activeQueue . timedOutTags . length ) {
7374 const currentBikeTagResponse = await adminBiketag . getTag ( undefined , { source : imageSource } ) // the "current" mystery tag to be updated from the main album
7475 if ( ! currentBikeTagResponse . success ) {
@@ -89,7 +90,7 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
8990 )
9091
9192 if ( autoSelectedWinningTag ) {
92- log ( 'winning tag found, setting new BikeTag post' , {
93+ log ( '[autopost] winning tag found, setting new BikeTag post' , {
9394 game : game . slug ,
9495 autoSelectedWinningTag,
9596 } , 'info' )
@@ -107,7 +108,7 @@ export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> =
107108 }
108109 }
109110 } else {
110- log ( 'couldnt get games' , gamesResponse , 'error' )
111+ log ( '[autopost] couldnt get games' , gamesResponse , 'error' )
111112 }
112113
113114 return {
@@ -120,13 +121,13 @@ export default async () => {
120121 const { results, errors } = await autoPostNewBikeTags ( )
121122
122123 if ( results . length ) {
123- log ( 'autopost attempted' , { results } , 'info' )
124+ log ( '[autopost] autopost attempted' , { results } , 'info' )
124125
125126 return new Response ( JSON . stringify ( results ) , {
126127 status : errors ? HttpStatusCode . BadRequest : HttpStatusCode . Ok ,
127128 } )
128129 } else {
129- log ( 'autopost ran' , 'nothing to report' , 'info' )
130+ log ( '[autopost] autopost ran' , 'nothing to report' , 'info' )
130131 return new Response ( '' , {
131132 status : errors ? HttpStatusCode . BadRequest : HttpStatusCode . Ok ,
132133 } )
0 commit comments