예제 #1
0
        protected override async Task <Result> InitializeInternal()
        {
            this.cancellationTokenSource = new CancellationTokenSource();

            this.channel = await this.GetChannel();

            if (this.channel != null)
            {
                foreach (StreamJarDonation donation in await this.GetDonations())
                {
                    donationsReceived[donation.ID] = donation;
                }

                AsyncRunner.RunBackgroundTask(this.cancellationTokenSource.Token, 60000, this.BackgroundDonationCheck);
                this.TrackServiceTelemetry("StreamJar");
                return(new Result());
            }
            return(new Result("Failed to get channel data"));
        }
예제 #2
0
        protected override async Task <Result> InitializeInternal()
        {
            this.cancellationTokenSource = new CancellationTokenSource();

            this.channel = await this.GetChannel();

            if (this.channel != null)
            {
                foreach (StreamJarDonation donation in await this.GetDonations())
                {
                    donationsReceived[donation.ID] = donation;
                }

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                AsyncRunner.RunAsyncBackground(this.BackgroundDonationCheck, this.cancellationTokenSource.Token, 60000);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                this.TrackServiceTelemetry("StreamJar");
                return(new Result());
            }
            return(new Result(Resources.StreamJarChannelDataFailed));
        }