An adaptive postdetector processing of signals is considered in this paper. This approach allows one to detect a weak signal by increasing the time of accumulation and to reduce the dynamic error in the presence of a strong signal when the time of accumulation is being decreased. It is shown, that the process at the output of the lidar sistem photodetector is Gaussian-Markovian one, for which the mean integral estimate of the mathematical expectation converges to the optimal one. The optimal observation time is found where the sum of the fluctuation and dynamic errors appears to be minimum. For the given maximum relative error of the signal recovering the threshold energy is determined that could provide for this error.